-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V5 $theme-colors #31089
Comments
Please consult the docs at https://v5.getbootstrap.com/docs/5.0/customize/sass/#maps-and-loops for how to modify Sass maps. We've removed the map merges as the majority of this can be tackled with built-in Sass tools as mentioned on that page. |
Sorry, but it says in the doc:
So i'm not sure to understand how to add a color in the theme to make for exemple my custom button as .btn-custom-color Should I merge myself the $theme-colors and insert it between the requirements and options files (like for the map-remove exemple ) ? |
Oh snap, you're right, sorry! We're missing some code there. Something like this would work for sure: $custom-theme-colors: (
"custom": $pink
);
$theme-colors: map-merge($theme-colors, $custom-theme-colors); Let me see if there's something simpler there as well. |
Fixes #31089. Co-authored-by: XhmikosR <[email protected]>
Hey just trying this myself, I'm not sure this works either?
|
Plop, I managed to make it work like this :
|
Fixes twbs#31089. Co-authored-by: XhmikosR <[email protected]>
Does anyone have a full document that map-merge your custom colours with the default once and you being able to use both the default so like I can do btn-info and I can use btn-custom-color for example. I just don’t understand the correct order of imports and such and that might help to see a complete sass file |
@MostlyDead This is how i do in my bootstrap.scss file:
|
I'm trying to see the value in having to move my variables to load after the BS variables, but I'm not. I feel like I went down that rabbit hole back in v4 and realized that I should just define my non-defaults in my variable sheet first, then let BS fill in the missing ones when it loads. This new way makes me have to re-define too many other variables down the page, like link color and link hover color. I'm still open for somebody to explain why the new BS 5 way is better... thanks! I still believe that somebody smarter than me architected and wrote it. |
Hi,
I just tried the new Bootstrap 5.0.0-alpha1 and when I wanted to add a new color to $theme-colors it override all the theme.
I compared the code with the v 4.5.0 and I found that in the file variables.scss the map-merge is missing.
In v4.5.0
In V5
The text was updated successfully, but these errors were encountered: