Skip to content

Commit df80866

Browse files
committed
Add doc entry for custom navbar-breakpoints
Signed-off-by: pine3ree <pine3ree@gmail.com>
1 parent 9e5ee90 commit df80866

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

  • site/content/docs/5.3/customize

site/content/docs/5.3/customize/sass.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,34 @@ $theme-colors: map-remove($theme-colors, "info", "light", "dark");
223223
// etc
224224
```
225225

226+
To remove breakpoints from `$navbar-breakpoints`, use `map-remove` on `$navbar-breakpoints` or `$grid-breakpoints`. Be aware that the initial breakpoint is always skipped by the `navbar-expand-` class generation loop:
227+
228+
```scss
229+
// Required
230+
@import "../node_modules/bootstrap/scss/functions";
231+
@import "../node_modules/bootstrap/scss/variables";
232+
@import "../node_modules/bootstrap/scss/variables-dark";
233+
234+
// $navbar-breakpoints MUST be a sub-map of $grid-breakpoints and it is defined
235+
// equal to it by default.
236+
// The following $navbar-breakpoints will be: sm, md, lg.
237+
// Since the first breakpoint is regarded as the base collapsed mode it will be
238+
// skipped and the resulting navbar classes will be:
239+
// - navbar-expand-md
240+
// - navbar-expand-lg
241+
// - navbar-expand
242+
$navbar-breakpoints: map-remove($navbar-breakpoints, "xs", "xl", "xxl");
243+
244+
@import "../node_modules/bootstrap/scss/maps";
245+
@import "../node_modules/bootstrap/scss/mixins";
246+
@import "../node_modules/bootstrap/scss/root";
247+
248+
// Optional
249+
@import "../node_modules/bootstrap/scss/reboot";
250+
@import "../node_modules/bootstrap/scss/type";
251+
// etc
252+
```
253+
226254
## Required keys
227255

228256
Bootstrap assumes the presence of some specific keys within Sass maps as we used and extend these ourselves. As you customize the included maps, you may encounter errors where a specific Sass map's key is being used.

0 commit comments

Comments
 (0)