Bootstrap v4.0.0.beta.2 introduces color maps allowing the use of theme-color("primary")
instead of $brand-primary
.
If I am adding my own custom CSS and want to utilize Bootstrap colors, what is the benefit of using the theme-color function over directly using variables like $primary
?
The bootstrap variables file includes:
$primary: $blue !default;
$secondary: $gray-600 !default;
$success: $green !default;
$info: $cyan !default;
$warning: $yellow !default;
$danger: $red !default;
$light: $gray-100 !default;
$dark: $gray-800 !default;
$theme-colors: () !default;
$theme-colors: map-merge((
"primary": $primary,
"secondary": $secondary,
"success": $success,
"info": $info,
"warning": $warning,
"danger": $danger,
"light": $light,
"dark": $dark
), $theme-colors);
Is there any specific reason for not just using $primary
or $gray-300
directly?
I do not have any complex SASS processes in my custom file, just plain CSS utilizing these variables.