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

Side by Side Diff: static/scss/_navbar.scss

Issue 29587584: Issue 5635 - Implement website-default navbar component (Closed) Base URL: https://hg.adblockplus.org/website-defaults
Patch Set: Variable for adding horizontal padding, link button class Created Dec. 11, 2017, 3:11 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « static/js/navbar.js ('k') | static/scss/_variables.scss » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // This file is part of help.eyeo.com.
2 // Copyright (C) 2017 Eyeo GmbH
3 //
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
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
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
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with help.eyeo.com. If not, see <http://www.gnu.org/licenses/>.
16
17 /*******************************************************************************
18 * Navbar component
19 ******************************************************************************/
20
21 .navbar
22 {
23 @extend .clearfix;
24 }
25
26 /* .navbar .navbar-container
27 ****************************************************************************/
28
29 .navbar-container
30 {
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 {
33 @extend .container;
34 }
35 @else
36 {
37 width: $container-width;
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 }
42 }
43
44 /* .navbar .navbar-branding
45 ****************************************************************************/
46
47 .navbar-branding
48 {
49 padding-top: $navbar-padding;
50 padding-bottom: $navbar-padding;
51
52 @if ($add-horizontal-navbar-padding != true)
53 {
54 padding-right: $navbar-padding;
55 padding-left: $navbar-padding;
56 }
57 }
58
59 .navbar-branding img
60 {
61 height: $navbar-branding-height;
62 vertical-align: text-top;
63 }
64
65 /* .navbar .toggle-navbar-collapse
66 ****************************************************************************/
67
68 .toggle-navbar-collapse
69 {
70 display: none;
71 padding-top: $navbar-padding + ($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);
73
74 @if ($add-horizontal-navbar-padding != true)
75 {
76 padding-right: $navbar-padding;
77 padding-left: $navbar-padding;
78 }
79 }
80
81 .js .toggle-navbar-collapse
82 {
83 display: block;
84
85 @media (min-width: $tablet-breakpoint)
86 {
87 display: none;
88 }
89 }
90
91 /* .navbar .navbar-collapse
92 ****************************************************************************/
93
94 .navbar-collapse
95 {
96 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
99 @media (min-width: $tablet-breakpoint)
100 {
101 float: right;
102 clear: none;
103 }
104 }
105
106 [dir="rtl"] .navbar-collapse
107 {
108 float: left;
109 }
110
111 .js .navbar-collapse
112 {
113 display: none;
114
115 @media (min-width: $tablet-breakpoint)
116 {
117 display: block;
118 }
119 }
120
121 .expanded .navbar-collapse
122 {
123 display: block;
124 width: 100%;
125
126 @media (min-width: $tablet-breakpoint)
127 {
128 width: auto;
129 }
130 }
131
132 /* .navbar .navbar-nav
133 ****************************************************************************/
134
135 .navbar .navbar-nav
136 {
137 @if ($add-horizontal-navbar-padding)
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 {
139 padding-bottom: $navbar-padding / 2;
140 }
141
142 @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 {
148 margin-right: -($navbar-padding / 2);
149 margin-left: -($navbar-padding / 2);
150 }
151 }
152 }
153
154 .navbar .navbar-nav li
155 {
156 @media (min-width: $tablet-breakpoint)
157 {
158 display: inline-block;
159 }
160 }
161
162 .navbar .navbar-nav a
163 {
164 display: block;
165 padding-top: $navbar-padding / 2;
166 padding-bottom: $navbar-padding / 2;
167
168 @if ($add-horizontal-navbar-padding != true)
169 {
170 padding-right: $navbar-padding;
171 padding-left: $navbar-padding;
172 }
173
174 @media (min-width: $tablet-breakpoint)
175 {
176 padding-top: $navbar-padding + ($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;
178 padding-bottom: $navbar-padding + ($navbar-padding / 2);
179 padding-left: $navbar-padding / 2;
180 }
181 }
OLDNEW
« no previous file with comments | « static/js/navbar.js ('k') | static/scss/_variables.scss » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld