Merge "InvalidRoleException-junits"
[portal.git] / portal-FE-common / src / styles / bootstrap / _navbar.scss
1 // Contents
2 //
3 // Navbar
4 // Navbar brand
5 // Navbar nav
6 // Navbar text
7 // Navbar divider
8 // Responsive navbar
9 // Navbar position
10 // Navbar themes
11
12
13 // Navbar
14 //
15 // Provide a static navbar from which we expand to create full-width, fixed, and
16 // other navbar variations.
17
18 .navbar {
19   position: relative;
20   display: flex;
21   flex-wrap: wrap; // allow us to do the line break for collapsing content
22   align-items: center;
23   justify-content: space-between; // space out brand from logo
24   padding: $navbar-padding-y $navbar-padding-x;
25
26   // Because flex properties aren't inherited, we need to redeclare these first
27   // few properities so that content nested within behave properly.
28   > .container,
29   > .container-fluid {
30     display: flex;
31     flex-wrap: wrap;
32     align-items: center;
33     justify-content: space-between;
34   }
35 }
36
37
38 // Navbar brand
39 //
40 // Used for brand, project, or site names.
41
42 .navbar-brand {
43   display: inline-block;
44   padding-top: $navbar-brand-padding-y;
45   padding-bottom: $navbar-brand-padding-y;
46   margin-right: $navbar-padding-x;
47   font-size: $navbar-brand-font-size;
48   line-height: inherit;
49   white-space: nowrap;
50
51   @include hover-focus {
52     text-decoration: none;
53   }
54 }
55
56
57 // Navbar nav
58 //
59 // Custom navbar navigation (doesn't require `.nav`, but does make use of `.nav-link`).
60
61 .navbar-nav {
62   display: flex;
63   flex-direction: column; // cannot use `inherit` to get the `.navbar`s value
64   padding-left: 0;
65   margin-bottom: 0;
66   list-style: none;
67
68   .nav-link {
69     padding-right: 0;
70     padding-left: 0;
71   }
72
73   .dropdown-menu {
74     position: static;
75     float: none;
76   }
77 }
78
79
80 // Navbar text
81 //
82 //
83
84 .navbar-text {
85   display: inline-block;
86   padding-top: $nav-link-padding-y;
87   padding-bottom: $nav-link-padding-y;
88 }
89
90
91 // Responsive navbar
92 //
93 // Custom styles for responsive collapsing and toggling of navbar contents.
94 // Powered by the collapse Bootstrap JavaScript plugin.
95
96 // When collapsed, prevent the toggleable navbar contents from appearing in
97 // the default flexbox row orienation. Requires the use of `flex-wrap: wrap`
98 // on the `.navbar` parent.
99 .navbar-collapse {
100   flex-basis: 100%;
101   flex-grow: 1;
102   // For always expanded or extra full navbars, ensure content aligns itself
103   // properly vertically. Can be easily overridden with flex utilities.
104   align-items: center;
105 }
106
107 // Button for toggling the navbar when in its collapsed state
108 .navbar-toggler {
109   padding: $navbar-toggler-padding-y $navbar-toggler-padding-x;
110   font-size: $navbar-toggler-font-size;
111   line-height: 1;
112   background-color: transparent; // remove default button style
113   border: $border-width solid transparent; // remove default button style
114   @include border-radius($navbar-toggler-border-radius);
115
116   @include hover-focus {
117     text-decoration: none;
118   }
119
120   // Opinionated: add "hand" cursor to non-disabled .navbar-toggler elements
121   &:not([disabled]):not(.disabled) {
122     cursor: pointer;
123   }
124 }
125
126 // Keep as a separate element so folks can easily override it with another icon
127 // or image file as needed.
128 .navbar-toggler-icon {
129   display: inline-block;
130   width: 1.5em;
131   height: 1.5em;
132   vertical-align: middle;
133   content: "";
134   background: no-repeat center center;
135   background-size: 100% 100%;
136 }
137
138 // Generate series of `.navbar-expand-*` responsive classes for configuring
139 // where your navbar collapses.
140 .navbar-expand {
141   @each $breakpoint in map-keys($grid-breakpoints) {
142     $next: breakpoint-next($breakpoint, $grid-breakpoints);
143     $infix: breakpoint-infix($next, $grid-breakpoints);
144
145     &#{$infix} {
146       @include media-breakpoint-down($breakpoint) {
147         > .container,
148         > .container-fluid {
149           padding-right: 0;
150           padding-left: 0;
151         }
152       }
153
154       @include media-breakpoint-up($next) {
155         flex-flow: row nowrap;
156         justify-content: flex-start;
157
158         .navbar-nav {
159           flex-direction: row;
160
161           .dropdown-menu {
162             position: absolute;
163           }
164
165           .dropdown-menu-right {
166             right: 0;
167             left: auto; // Reset the default from `.dropdown-menu`
168           }
169
170           .nav-link {
171             padding-right: .5rem;
172             padding-left: .5rem;
173           }
174         }
175
176         // For nesting containers, have to redeclare for alignment purposes
177         > .container,
178         > .container-fluid {
179           flex-wrap: nowrap;
180         }
181
182         .navbar-collapse {
183           display: flex !important;  // stylelint-disable-line declaration-no-important
184
185           // Changes flex-bases to auto because of an IE10 bug
186           flex-basis: auto;
187         }
188
189         .navbar-toggler {
190           display: none;
191         }
192
193         .dropup {
194           .dropdown-menu {
195             top: auto;
196             bottom: 100%;
197           }
198         }
199       }
200     }
201   }
202 }
203
204
205 // Navbar themes
206 //
207 // Styles for switching between navbars with light or dark background.
208
209 // Dark links against a light background
210 .navbar-light {
211   .navbar-brand {
212     color: $navbar-light-active-color;
213
214     @include hover-focus {
215       color: $navbar-light-active-color;
216     }
217   }
218
219   .navbar-nav {
220     .nav-link {
221       color: $navbar-light-color;
222
223       @include hover-focus {
224         color: $navbar-light-hover-color;
225       }
226
227       &.disabled {
228         color: $navbar-light-disabled-color;
229       }
230     }
231
232     .show > .nav-link,
233     .active > .nav-link,
234     .nav-link.show,
235     .nav-link.active {
236       color: $navbar-light-active-color;
237     }
238   }
239
240   .navbar-toggler {
241     color: $navbar-light-color;
242     border-color: $navbar-light-toggler-border-color;
243   }
244
245   .navbar-toggler-icon {
246     background-image: $navbar-light-toggler-icon-bg;
247   }
248
249   .navbar-text {
250     color: $navbar-light-color;
251     a {
252       color: $navbar-light-active-color;
253
254       @include hover-focus {
255         color: $navbar-light-active-color;
256       }
257     }
258   }
259 }
260
261 // White links against a dark background
262 .navbar-dark {
263   .navbar-brand {
264     color: $navbar-dark-active-color;
265
266     @include hover-focus {
267       color: $navbar-dark-active-color;
268     }
269   }
270
271   .navbar-nav {
272     .nav-link {
273       color: $navbar-dark-color;
274
275       @include hover-focus {
276         color: $navbar-dark-hover-color;
277       }
278
279       &.disabled {
280         color: $navbar-dark-disabled-color;
281       }
282     }
283
284     .show > .nav-link,
285     .active > .nav-link,
286     .nav-link.show,
287     .nav-link.active {
288       color: $navbar-dark-active-color;
289     }
290   }
291
292   .navbar-toggler {
293     color: $navbar-dark-color;
294     border-color: $navbar-dark-toggler-border-color;
295   }
296
297   .navbar-toggler-icon {
298     background-image: $navbar-dark-toggler-icon-bg;
299   }
300
301   .navbar-text {
302     color: $navbar-dark-color;
303     a {
304       color: $navbar-dark-active-color;
305
306       @include hover-focus {
307         color: $navbar-dark-active-color;
308       }
309     }
310   }
311 }