Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: static/scss/_navbar.scss

Issue 29587584: Issue 5635 - Implement website-default navbar component (Closed) Base URL: https://hg.adblockplus.org/website-defaults
Left Patch Set: Variable for adding horizontal padding, link button class Created Dec. 11, 2017, 3:11 p.m.
Right Patch Set: Rebase Created Jan. 4, 2018, 7:40 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « static/js/navbar.js ('k') | static/scss/_variables.scss » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // This file is part of help.eyeo.com. 1 // This file is part of help.eyeo.com.
2 // Copyright (C) 2017 Eyeo GmbH 2 // Copyright (C) 2017 Eyeo GmbH
3 // 3 //
4 // help.eyeo.com is free software: you can redistribute it and/or modify 4 // help.eyeo.com is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by 5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or 6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version. 7 // (at your option) any later version.
8 // 8 //
9 // help.eyeo.com is distributed in the hope that it will be useful, 9 // help.eyeo.com is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 10 matching lines...) Expand all
21 .navbar 21 .navbar
22 { 22 {
23 @extend .clearfix; 23 @extend .clearfix;
24 } 24 }
25 25
26 /* .navbar .navbar-container 26 /* .navbar .navbar-container
27 ****************************************************************************/ 27 ****************************************************************************/
28 28
29 .navbar-container 29 .navbar-container
30 { 30 {
31 @if ($add-horizontal-navbar-padding) 31 @if ($add-horizontal-navbar-padding)
juliandoucette 2017/12/13 16:17:38 NIT/Suggest: Check if $navbar-padding-x (or simila
ire 2017/12/14 10:26:36 I ended up with this solution for a couple of reas
32 { 32 {
33 @extend .container; 33 @extend .container;
34 } 34 }
35 @else 35 @else
36 { 36 {
37 width: $container-width; 37 @include container($container-width, 0px);
juliandoucette 2017/12/13 16:17:37 TOL: It might be cleaner to create a container mix
ire 2017/12/14 10:26:34 Great idea! Done.
38 max-width: 100%;
39 margin-right: auto;
40 margin-left: auto;
41 } 38 }
42 } 39 }
43 40
44 /* .navbar .navbar-branding 41 /* .navbar .navbar-branding
45 ****************************************************************************/ 42 ****************************************************************************/
46 43
47 .navbar-branding 44 .navbar-branding
48 { 45 {
49 padding-top: $navbar-padding; 46 padding-top: $navbar-padding + ($navbar-padding / 4);
50 padding-bottom: $navbar-padding; 47 padding-bottom: $navbar-padding + ($navbar-padding / 4);
48 line-height: 1;
51 49
52 @if ($add-horizontal-navbar-padding != true) 50 @if ($add-horizontal-navbar-padding != true)
53 { 51 {
54 padding-right: $navbar-padding; 52 padding-right: $navbar-padding;
55 padding-left: $navbar-padding; 53 padding-left: $navbar-padding;
56 } 54 }
57 } 55 }
58 56
59 .navbar-branding img 57 .navbar-branding img
60 { 58 {
61 height: $navbar-branding-height; 59 height: $navbar-branding-height;
62 vertical-align: text-top; 60 vertical-align: text-top;
63 } 61 }
64 62
65 /* .navbar .toggle-navbar-collapse 63 /* .navbar .toggle-navbar-collapse
66 ****************************************************************************/ 64 ****************************************************************************/
67 65
68 .toggle-navbar-collapse 66 .toggle-navbar-collapse
69 { 67 {
70 display: none; 68 display: none;
71 padding-top: $navbar-padding + ($navbar-padding / 2); 69 padding-top: ($navbar-branding-height / 2) + ($navbar-padding / 2);
juliandoucette 2017/12/13 16:17:37 This doesn't scale with the toggle button height.
72 padding-bottom: $navbar-padding + ($navbar-padding / 2); 70 padding-bottom: ($navbar-branding-height / 2) + ($navbar-padding / 2);
73 71
74 @if ($add-horizontal-navbar-padding != true) 72 @if ($add-horizontal-navbar-padding != true)
75 { 73 {
76 padding-right: $navbar-padding; 74 padding-right: $navbar-padding;
77 padding-left: $navbar-padding; 75 padding-left: $navbar-padding;
78 } 76 }
79 } 77 }
80 78
81 .js .toggle-navbar-collapse 79 .js .toggle-navbar-collapse
82 { 80 {
83 display: block; 81 display: block;
84 82
85 @media (min-width: $tablet-breakpoint) 83 @media (min-width: $tablet-breakpoint)
86 { 84 {
87 display: none; 85 display: none;
88 } 86 }
89 } 87 }
90 88
91 /* .navbar .navbar-collapse 89 /* .navbar .navbar-collapse
92 ****************************************************************************/ 90 ****************************************************************************/
93 91
94 .navbar-collapse 92 .navbar-collapse
95 { 93 {
96 clear: both; 94 clear: both;
97 padding-top: 0;
juliandoucette 2017/12/13 16:17:36 Why is this necessary?
ire 2017/12/14 10:26:36 Looks like it isn't :/ Must've been from a previou
98 95
99 @media (min-width: $tablet-breakpoint) 96 @media (min-width: $tablet-breakpoint)
100 { 97 {
101 float: right; 98 float: right;
102 clear: none; 99 clear: none;
103 } 100 }
104 } 101 }
105 102
106 [dir="rtl"] .navbar-collapse 103 [dir="rtl"] .navbar-collapse
107 { 104 {
(...skipping 17 matching lines...) Expand all
125 122
126 @media (min-width: $tablet-breakpoint) 123 @media (min-width: $tablet-breakpoint)
127 { 124 {
128 width: auto; 125 width: auto;
129 } 126 }
130 } 127 }
131 128
132 /* .navbar .navbar-nav 129 /* .navbar .navbar-nav
133 ****************************************************************************/ 130 ****************************************************************************/
134 131
135 .navbar .navbar-nav 132 @if ($add-horizontal-navbar-padding)
136 { 133 {
137 @if ($add-horizontal-navbar-padding) 134 .navbar .navbar-nav
juliandoucette 2017/12/13 16:17:36 A vertical padding dependant on horizontal padding
ire 2017/12/14 10:26:37 Yes, that vertical padding is only needed if there
juliandoucette 2017/12/14 12:55:41 Acknowledged.
138 { 135 {
139 padding-bottom: $navbar-padding / 2; 136 padding-bottom: $navbar-padding / 2;
140 }
141 137
142 @media (min-width: $tablet-breakpoint) 138 @media (min-width: $tablet-breakpoint)
143 {
144 padding-bottom: 0;
juliandoucette 2017/12/13 16:17:37 This is only necessary if the previous condition i
ire 2017/12/14 10:26:36 Done.
145
146 @if ($add-horizontal-navbar-padding)
147 { 139 {
148 margin-right: -($navbar-padding / 2); 140 margin-right: -($navbar-padding / 2);
149 margin-left: -($navbar-padding / 2); 141 margin-left: -($navbar-padding / 2);
142 padding-bottom: 0;
150 } 143 }
151 } 144 }
152 } 145 }
153 146
154 .navbar .navbar-nav li 147 .navbar .navbar-nav li
155 { 148 {
156 @media (min-width: $tablet-breakpoint) 149 @media (min-width: $tablet-breakpoint)
157 { 150 {
158 display: inline-block; 151 display: inline-block;
159 } 152 }
160 } 153 }
161 154
162 .navbar .navbar-nav a 155 .navbar .navbar-nav a
163 { 156 {
164 display: block; 157 display: block;
165 padding-top: $navbar-padding / 2; 158 padding-top: $navbar-padding / 2;
166 padding-bottom: $navbar-padding / 2; 159 padding-bottom: $navbar-padding / 2;
167 160
168 @if ($add-horizontal-navbar-padding != true) 161 @if ($add-horizontal-navbar-padding != true)
169 { 162 {
170 padding-right: $navbar-padding; 163 padding-right: $navbar-padding;
171 padding-left: $navbar-padding; 164 padding-left: $navbar-padding;
172 } 165 }
173 166
174 @media (min-width: $tablet-breakpoint) 167 @media (min-width: $tablet-breakpoint)
175 { 168 {
176 padding-top: $navbar-padding + ($navbar-padding / 2); 169 padding-top: ($navbar-branding-height / 2) + ($navbar-padding / 2);
juliandoucette 2017/12/13 16:17:36 It seems like both the navbar nav items and the to
ire 2017/12/14 10:26:34 I've made some changes to address this
juliandoucette 2017/12/14 12:55:41 Would you mind explaining your logic?
ire 2017/12/16 09:51:35 Sure :) The issue previously was that if the $nav
177 padding-right: $navbar-padding / 2; 170 padding-right: $navbar-padding / 2;
178 padding-bottom: $navbar-padding + ($navbar-padding / 2); 171 padding-bottom: ($navbar-branding-height / 2) + ($navbar-padding / 2);
179 padding-left: $navbar-padding / 2; 172 padding-left: $navbar-padding / 2;
180 } 173 }
181 } 174 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld