css - How to use the bootstrap 4 SASS mixins with customization in Angular 7 without importing multiple bootstraps
问题描述
In my angular.json this is what I have
"styles": [
"src/assets/styles.scss"
],
and in my styles.scss, I added my custom.scss
@import 'vendor/bootstrap/scss/custom';
in my custom.scss, this is what I have
// custom 24 grid system
$grid-columns: 24;
@import "node_modules/bootstrap/scss/bootstrap";
In my SASS partials files, I can use the bootstrap 4 mixins without importing my custom.scss file but for a scss file that's coupled with an Angular component, I have to import custom.scss file like this to use any of the bootstrap 4 mixins.
@import 'vendor/bootstrap/scss/custom';
but if I do this, in my style sheet, I see bootstrap being imported twice. How can I avoid duplicate imports? I've tried to add my custom.scss straight to my angular.json file but that also duplicated the import.
解决方案
推荐阅读
- powershell - Powershell 将新项目添加到枚举列表
- java - 如何从文本文件中随机选择一段文本
- jaxb - JAXB:如何列出具有不同标签名称的相同子元素
- c++ - _GLIBCXX_USE_CXX11_ABI 在 RHEL6 和 RHEL7 上禁用?
- c# - 反序列化 XML 数据
- c# - 有没有 NetworkBehaviour 的类似 [SyncVar(hook = "OnChangeHealth")] 的函数?
- reactjs - 更改 material-ui 的选择器格式
- vuejs2 - 当 vuex 存储中的状态发生变化时更新我的 for 循环
- sql - sequelize.js $like 运算符中的 % 符号是什么意思?
- c++ - const 方法使用引用修改对象