更新 Bootstrap 4.1按钮 mixins 略有变化,现在需要 add'l params....btn-custom {@include button-variant(#cece19, #222222, #cece19, #cece19, #cece19, #cece19);}.btn-自定义大纲{@include button-outline-variant(#222222, #cece19, #222222, #cece19);}@import "引导程序";I'm starting to navigate through the wonderful Bootstrap 4 and I'm wondering how to add a whole new set of elements color to the _custom.scssExample: Right now you have btn-danger, text-danger etc... how to create for example, using a random name: "crisp" set... so you will have btn-crisp, text-crisp etc...My guess would be to start with adding a variable $brand-crisp: #color !default;But, then what? Thanks! I appreciate your help. 解决方案 There is not an all inclusive color mixin, so I think you need to use the mixins individually....btn-custom { @include button-variant(#cece19, #222222, #cece19);}.btn-custom-outline { @include button-outline-variant(#222222);}.card-custom { @include card-variant(#aa9999, #997777)}http://www.codeply.com/go/MKGQCrLwDsUpdate: In Bootstrap 4, you now can create a new custom "theme-color" to as explained in my answer here. This will allow you to use the color anywhere such as btn-custom, text-custom, bg-custom, etc...Update Bootstrap 4.1The button mixins have changed slightly and now require add'l params....btn-custom { @include button-variant(#cece19, #222222, #cece19, #cece19, #cece19, #cece19);}.btn-custom-outline { @include button-outline-variant(#222222, #cece19, #222222, #cece19);}@import "bootstrap"; 这篇关于如何使用 sass 在 Bootstrap 4 中创建一组新的颜色样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-22 14:23