Replies: 2 comments 2 replies
-
Try this: /* import the original Bootstrap files first */
@import "functions";
@import "variables";
/* next, set whatever customization you want */
$primary: $green-500;
$secondary: $pink-500;
$theme-colors: (
"primary": $primary,
"secondary": $secondary
);
/* finally, import Bootstrap to accept your changes */
@import "bootstrap"; |
Beta Was this translation helpful? Give feedback.
1 reply
-
Just found the solution from this site. We need to redefine all the remaining default colors to get them along with our custom ones:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Bootstrap 5 has various theme colors like
gray-500
,green-500
, etc. If we want to use these colors anywhere else after importing_variables.scss
it works perfectly fine.But suppose I want to change the
$primary
theme variable to a value from these built-in theme colors, like this:It says the variable green-500 is not found and I understand as we need to import
_variables.scss
first. But if we do that then we loose the functionality of overriding the$primary
variable.Beta Was this translation helpful? Give feedback.
All reactions