Updated .bg-* and .text-* utilities break when CSS variables are not enabled in v5.1.0 #34756
Comments
|
|
|
The whole bg-, text- update in 5.1.0 has seemingly complicated the entire process of adding a new theme-color. The only way I could find to get the bg- and text- classes regenerated for the new "custom" theme color is.... I discovered this on an SO question and here's the working code demo Whereas in 5.0.2 one could simply follow the example in the docs... |
|
In addition to that, the suggested way of extending color utility classes generates HEX color values instead of RGBA and still keeps useless |
Thanks! |
|
I consider this either a regression or a lack in documentation. |
|
Oh, and btw the same is true if you need to add spacing classes: |
|
arrrggghhhh add +1 to frustration of note. this change has had me tearing my hair out. i sort of got it working with _variables.scss (my custom variables) styles.scss (main style) at the devs, its changes like this that might actually drive people away tho. would suggest you consider "ability and ease of extending bootstrap" as a core just like getting the code working right. i know people might disagree with this, but this change for instance has some what had me questioning if bootstrap and me remain in a loving relationship or not). 12k lines of css :( last i looked it was around 8 or so |
|
Sorry we've been slow to investigate and identify a path forward. We'll need a little more time to experiment and validate the issues identified here. Definitely not in our interest to be causing headaches for folks :). |
|
Hehe thanks mdo. I think the 5.1 update took a few people by surprise. Some "breaking" things like this but on the face of it it looks like 5.0 but it's still a big update. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

In one of my projects I include the needed Bootstrap SCSS files manually and specifically exclude
bootstrap/scss/root, first because I don't rely on most of the CSS variables and secondly because adding all CSS variables increases the CSS file size by about 50-60kb (uncompressed).With v5.1.0 all
.bg-*and.text-*utilities break, as the needed CSS variables are missing, e.g.Is there a simple way to disable CSS variables generation or to reduce the number of CSS variables? The only way forward right now would be to revert the utility sets back to
$theme-colors, but that still leaves an additional--bs-text-opacity: 1;and does not take care of--bs-body-colorand the like:The text was updated successfully, but these errors were encountered: