source: imaps-frontend/node_modules/bootstrap/scss/_navbar.scss

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 8.9 KB
RevLine 
[d565449]1// Navbar
2//
3// Provide a static navbar from which we expand to create full-width, fixed, and
4// other navbar variations.
5
6.navbar {
7 // scss-docs-start navbar-css-vars
8 --#{$prefix}navbar-padding-x: #{if($navbar-padding-x == null, 0, $navbar-padding-x)};
9 --#{$prefix}navbar-padding-y: #{$navbar-padding-y};
10 --#{$prefix}navbar-color: #{$navbar-light-color};
11 --#{$prefix}navbar-hover-color: #{$navbar-light-hover-color};
12 --#{$prefix}navbar-disabled-color: #{$navbar-light-disabled-color};
13 --#{$prefix}navbar-active-color: #{$navbar-light-active-color};
14 --#{$prefix}navbar-brand-padding-y: #{$navbar-brand-padding-y};
15 --#{$prefix}navbar-brand-margin-end: #{$navbar-brand-margin-end};
16 --#{$prefix}navbar-brand-font-size: #{$navbar-brand-font-size};
17 --#{$prefix}navbar-brand-color: #{$navbar-light-brand-color};
18 --#{$prefix}navbar-brand-hover-color: #{$navbar-light-brand-hover-color};
19 --#{$prefix}navbar-nav-link-padding-x: #{$navbar-nav-link-padding-x};
20 --#{$prefix}navbar-toggler-padding-y: #{$navbar-toggler-padding-y};
21 --#{$prefix}navbar-toggler-padding-x: #{$navbar-toggler-padding-x};
22 --#{$prefix}navbar-toggler-font-size: #{$navbar-toggler-font-size};
23 --#{$prefix}navbar-toggler-icon-bg: #{escape-svg($navbar-light-toggler-icon-bg)};
24 --#{$prefix}navbar-toggler-border-color: #{$navbar-light-toggler-border-color};
25 --#{$prefix}navbar-toggler-border-radius: #{$navbar-toggler-border-radius};
26 --#{$prefix}navbar-toggler-focus-width: #{$navbar-toggler-focus-width};
27 --#{$prefix}navbar-toggler-transition: #{$navbar-toggler-transition};
28 // scss-docs-end navbar-css-vars
29
30 position: relative;
31 display: flex;
32 flex-wrap: wrap; // allow us to do the line break for collapsing content
33 align-items: center;
34 justify-content: space-between; // space out brand from logo
35 padding: var(--#{$prefix}navbar-padding-y) var(--#{$prefix}navbar-padding-x);
36 @include gradient-bg();
37
38 // Because flex properties aren't inherited, we need to redeclare these first
39 // few properties so that content nested within behave properly.
40 // The `flex-wrap` property is inherited to simplify the expanded navbars
41 %container-flex-properties {
42 display: flex;
43 flex-wrap: inherit;
44 align-items: center;
45 justify-content: space-between;
46 }
47
48 > .container,
49 > .container-fluid {
50 @extend %container-flex-properties;
51 }
52
53 @each $breakpoint, $container-max-width in $container-max-widths {
54 > .container#{breakpoint-infix($breakpoint, $container-max-widths)} {
55 @extend %container-flex-properties;
56 }
57 }
58}
59
60
61// Navbar brand
62//
63// Used for brand, project, or site names.
64
65.navbar-brand {
66 padding-top: var(--#{$prefix}navbar-brand-padding-y);
67 padding-bottom: var(--#{$prefix}navbar-brand-padding-y);
68 margin-right: var(--#{$prefix}navbar-brand-margin-end);
69 @include font-size(var(--#{$prefix}navbar-brand-font-size));
70 color: var(--#{$prefix}navbar-brand-color);
71 text-decoration: if($link-decoration == none, null, none);
72 white-space: nowrap;
73
74 &:hover,
75 &:focus {
76 color: var(--#{$prefix}navbar-brand-hover-color);
77 text-decoration: if($link-hover-decoration == underline, none, null);
78 }
79}
80
81
82// Navbar nav
83//
84// Custom navbar navigation (doesn't require `.nav`, but does make use of `.nav-link`).
85
86.navbar-nav {
87 // scss-docs-start navbar-nav-css-vars
88 --#{$prefix}nav-link-padding-x: 0;
89 --#{$prefix}nav-link-padding-y: #{$nav-link-padding-y};
90 @include rfs($nav-link-font-size, --#{$prefix}nav-link-font-size);
91 --#{$prefix}nav-link-font-weight: #{$nav-link-font-weight};
92 --#{$prefix}nav-link-color: var(--#{$prefix}navbar-color);
93 --#{$prefix}nav-link-hover-color: var(--#{$prefix}navbar-hover-color);
94 --#{$prefix}nav-link-disabled-color: var(--#{$prefix}navbar-disabled-color);
95 // scss-docs-end navbar-nav-css-vars
96
97 display: flex;
98 flex-direction: column; // cannot use `inherit` to get the `.navbar`s value
99 padding-left: 0;
100 margin-bottom: 0;
101 list-style: none;
102
103 .nav-link {
104 &.active,
105 &.show {
106 color: var(--#{$prefix}navbar-active-color);
107 }
108 }
109
110 .dropdown-menu {
111 position: static;
112 }
113}
114
115
116// Navbar text
117//
118//
119
120.navbar-text {
121 padding-top: $nav-link-padding-y;
122 padding-bottom: $nav-link-padding-y;
123 color: var(--#{$prefix}navbar-color);
124
125 a,
126 a:hover,
127 a:focus {
128 color: var(--#{$prefix}navbar-active-color);
129 }
130}
131
132
133// Responsive navbar
134//
135// Custom styles for responsive collapsing and toggling of navbar contents.
136// Powered by the collapse Bootstrap JavaScript plugin.
137
138// When collapsed, prevent the toggleable navbar contents from appearing in
139// the default flexbox row orientation. Requires the use of `flex-wrap: wrap`
140// on the `.navbar` parent.
141.navbar-collapse {
142 flex-basis: 100%;
143 flex-grow: 1;
144 // For always expanded or extra full navbars, ensure content aligns itself
145 // properly vertically. Can be easily overridden with flex utilities.
146 align-items: center;
147}
148
149// Button for toggling the navbar when in its collapsed state
150.navbar-toggler {
151 padding: var(--#{$prefix}navbar-toggler-padding-y) var(--#{$prefix}navbar-toggler-padding-x);
152 @include font-size(var(--#{$prefix}navbar-toggler-font-size));
153 line-height: 1;
154 color: var(--#{$prefix}navbar-color);
155 background-color: transparent; // remove default button style
156 border: var(--#{$prefix}border-width) solid var(--#{$prefix}navbar-toggler-border-color); // remove default button style
157 @include border-radius(var(--#{$prefix}navbar-toggler-border-radius));
158 @include transition(var(--#{$prefix}navbar-toggler-transition));
159
160 &:hover {
161 text-decoration: none;
162 }
163
164 &:focus {
165 text-decoration: none;
166 outline: 0;
167 box-shadow: 0 0 0 var(--#{$prefix}navbar-toggler-focus-width);
168 }
169}
170
171// Keep as a separate element so folks can easily override it with another icon
172// or image file as needed.
173.navbar-toggler-icon {
174 display: inline-block;
175 width: 1.5em;
176 height: 1.5em;
177 vertical-align: middle;
178 background-image: var(--#{$prefix}navbar-toggler-icon-bg);
179 background-repeat: no-repeat;
180 background-position: center;
181 background-size: 100%;
182}
183
184.navbar-nav-scroll {
185 max-height: var(--#{$prefix}scroll-height, 75vh);
186 overflow-y: auto;
187}
188
189// scss-docs-start navbar-expand-loop
190// Generate series of `.navbar-expand-*` responsive classes for configuring
191// where your navbar collapses.
192.navbar-expand {
193 @each $breakpoint in map-keys($grid-breakpoints) {
194 $next: breakpoint-next($breakpoint, $grid-breakpoints);
195 $infix: breakpoint-infix($next, $grid-breakpoints);
196
197 // stylelint-disable-next-line scss/selector-no-union-class-name
198 &#{$infix} {
199 @include media-breakpoint-up($next) {
200 flex-wrap: nowrap;
201 justify-content: flex-start;
202
203 .navbar-nav {
204 flex-direction: row;
205
206 .dropdown-menu {
207 position: absolute;
208 }
209
210 .nav-link {
211 padding-right: var(--#{$prefix}navbar-nav-link-padding-x);
212 padding-left: var(--#{$prefix}navbar-nav-link-padding-x);
213 }
214 }
215
216 .navbar-nav-scroll {
217 overflow: visible;
218 }
219
220 .navbar-collapse {
221 display: flex !important; // stylelint-disable-line declaration-no-important
222 flex-basis: auto;
223 }
224
225 .navbar-toggler {
226 display: none;
227 }
228
229 .offcanvas {
230 // stylelint-disable declaration-no-important
231 position: static;
232 z-index: auto;
233 flex-grow: 1;
234 width: auto !important;
235 height: auto !important;
236 visibility: visible !important;
237 background-color: transparent !important;
238 border: 0 !important;
239 transform: none !important;
240 @include box-shadow(none);
241 @include transition(none);
242 // stylelint-enable declaration-no-important
243
244 .offcanvas-header {
245 display: none;
246 }
247
248 .offcanvas-body {
249 display: flex;
250 flex-grow: 0;
251 padding: 0;
252 overflow-y: visible;
253 }
254 }
255 }
256 }
257 }
258}
259// scss-docs-end navbar-expand-loop
260
261// Navbar themes
262//
263// Styles for switching between navbars with light or dark background.
264
265.navbar-light {
266 @include deprecate("`.navbar-light`", "v5.2.0", "v6.0.0", true);
267}
268
269.navbar-dark,
270.navbar[data-bs-theme="dark"] {
271 // scss-docs-start navbar-dark-css-vars
272 --#{$prefix}navbar-color: #{$navbar-dark-color};
273 --#{$prefix}navbar-hover-color: #{$navbar-dark-hover-color};
274 --#{$prefix}navbar-disabled-color: #{$navbar-dark-disabled-color};
275 --#{$prefix}navbar-active-color: #{$navbar-dark-active-color};
276 --#{$prefix}navbar-brand-color: #{$navbar-dark-brand-color};
277 --#{$prefix}navbar-brand-hover-color: #{$navbar-dark-brand-hover-color};
278 --#{$prefix}navbar-toggler-border-color: #{$navbar-dark-toggler-border-color};
279 --#{$prefix}navbar-toggler-icon-bg: #{escape-svg($navbar-dark-toggler-icon-bg)};
280 // scss-docs-end navbar-dark-css-vars
281}
282
283@if $enable-dark-mode {
284 @include color-mode(dark) {
285 .navbar-toggler-icon {
286 --#{$prefix}navbar-toggler-icon-bg: #{escape-svg($navbar-dark-toggler-icon-bg)};
287 }
288 }
289}
Note: See TracBrowser for help on using the repository browser.