Hi Stackoverflow Fans,
how can I @extend bootstrap classes using customized colors ?
Firstly, I created my customised colors in my custom-bootstrap.scss:
$theme-colors: (
'primary': #3b86ff,
'secondary': #6c757d,
'success': #28a745,
'error': #dc3545,
'white': #FFFFFF,
// Neutrals
'grey-0': #f9f9fa,
'grey-1': #eceef0,
'grey-2': #dee1e5,
'grey-3': #cfd3da,
'grey-4': #bfc4cd,
'grey-5': #adb3bf,
'grey-6': #98a0ae,
'grey-7': #828a97,
'grey-8': #666d77,
'grey-9': #3c3f46
);
Now I want to create some customized classes based on (that extends) Bootstrap classes. For example:
The class below compiles and works
.my-info-card {
@extend .card, .bg-light, .border, .bg-secondary, .text-dark;
}
The class below does NOT compile
.my-info-card2 {
@extend .card, .border-gray-5, .m-3, .mt-2;
}
I get a compilation error:
SassError: The target selector was not found. Use "@extend .border-gray-5 !optional" to avoid this error. ╷ 130 │ @extend .card, .border-gray-5, .m-3, .mt-2; │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The code below works as expected, but I want replace the css class by my-info-card2:
<div class="card border-gray-5 m-3 mt-2">