我有一个使用angular-cli 1.0和引导程序4-alpha6的Angular 4应用程序。 我想定制Bootstrap 4.例如改变主要按钮的颜色。如何使用angular-cli定制引导程序4
它必须是未来证明的解决方案。这意味着我的定制必须在稍后的时间点存在升级引导。
我已经通过集成bootstrap: 将"bootstrap": "4.0.0-alpha.6",
添加到我的package.json文件中的依赖关系。 此外我在角cli.json加入
"styles": [
"../node_modules/bootstrap/dist/css/bootstrap.min.css"
],
到"apps"
。
我的第一次尝试是创建一个名为style.scss的新文件,将其放入src/assets中,并在angular-cli.json中引用它。
内容看起来是这样的:
@import "../../node_modules/bootstrap/scss/variables";
@import "../../node_modules/bootstrap/scss/mixins";
$body-bg: $gray-dark;
$body-color: $gray-light;
当运行ng serve
应用comiles不错,但我看不出有什么变化。
我甚至开始正确的方向吗?我将如何通过干净的角度气候工作流程中的sass正确定制引导按钮/样式?
您可以在这里找到来源:https://github.com/nemoo/democratizer-angular/tree/ngbootstrap/frontend-angular
请注意,您现在也可以例如'@import'〜bootstrap/scss/bootstrap'' – Leo