如何从引导程序中获取仅支持我的导航栏菜单而不支持整个引导程序库的scss文件?

时间:2019-03-28 07:28:02

标签: html sass bootstrap-4

我从引导程序下载scss文件时遇到问题,我有太多@import不需要,我只需要@import nav和navbar,但是会发生很多错误。是否有引导程序生成器或任何其他方式可以帮助我解决此问题?

1 个答案:

答案 0 :(得分:2)

很难说为什么在不看到代码的情况下出现如此多的错误,但是通常,如果您只想要navnavbar的样式,则可以这样导入:< / p>

// custom.scss
// Required
@import "../../node_modules/bootstrap/scss/functions";
@import "../../node_modules/bootstrap/scss/variables";
@import "../../node_modules/bootstrap/scss/mixins";

@import "../../node_modules/bootstrap/scss/nav";
@import "../../node_modules/bootstrap/scss/navbar";

假设您的项目结构为:

WebProject
- Assets
  - css
    - custom.scss
- node_modules
  - bootstrap