Bulma - Show Uncollapsed Navbar on Tablet

≡放荡痞女 提交于 2019-12-06 12:32:49

You can set $navbar-breakpoint variable to tablet. By default navbar breakpoint is set to desktop.

In your main.scss, update Bulma's $navbar-breakpoint variable.

// Import only what you need from Bulma
@import "../node_modules/bulma/sass/utilities/_all.sass";
@import "../node_modules/bulma/sass/base/_all.sass";
@import "../node_modules/bulma/sass/elements/button.sass";
@import "../node_modules/bulma/sass/elements/container.sass";
@import "../node_modules/bulma/sass/elements/form.sass";
@import "../node_modules/bulma/sass/elements/title.sass";

$navbar-breakpoint: $tablet;

@import "../node_modules/bulma/sass/components/navbar.sass";
@import "../node_modules/bulma/sass/layout/hero.sass";
@import "../node_modules/bulma/sass/layout/section.sass";
@import "../node_modules/bulma/sass/grid/columns.sass";

I'm setting $navbar-breakpoint variable to the value of $tablet after importing _all.sass utilities. You need to do that because $tablet variable has to get set first.

After that you need to set$navbar-breakpoint variable before importing navbar component, otherwise default desktop value will be used.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!