How to create new set of color styles in Bootstrap 4 with sass

后端 未结 3 1851
青春惊慌失措
青春惊慌失措 2021-01-18 02:43

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.scss

Example: Right now y

3条回答
  •  失恋的感觉
    2021-01-18 03:36

    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/MKGQCrLwDs


    Update: 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.1

    The 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";
    

提交回复
热议问题