Consider this a bit of an integration branch for now while work on v5.0.2 continues. I'm using this to consolidate efforts across a handful of PRs.
Changes
-
cda10d6: Updates
.text-{color}and.bg-{color}utilities to use CSS variables.Both
.text-{color}and.bg-{color}utilities are now powered by CSS variables. For example, we use the new--bs-primary-rgb: 13, 110, 253and--bs-text-opacity(with no default value, but a fallback of1) in.text-primarywhere the new computed style iscolor: rgba(13, 110, 253, 1).We generate these new RGB variables with some new functions that convert hex values to RGB and that generate new Sass maps based on our
$theme-colorsmap. These new maps are now used to generate our utilities for textcolorandbackground-colorand include new options for.{text|bg}-black,.{text|bg}-white, and.{text|bg}-body.The utility API has been updated to include a new
css-varboolean option. When set totrue, it generates only local CSS variables using the API'sclassand individual values. This is how we've added our new.text-opacity-*and.bg-opacity-*utilities. Add these new classes alonside.text-{color}and.bg-{color}utilities to set their alpha transparency on the fly.This also deprecates
.text-black-50and.text-white-50since we can create those on the fly now.Fixes #33320 (closed). Fixes #33985 (closed).
-
c754e3e: Adds additional
:rootCSS variables for all our shades of gray and some$body-Sass variables.Previously our
:rootCSS variables only included our$colorsand$theme-colors. Now they also include$grays. We've also added new CSS variables for common<body>styles with default values set by their Sass variable counterparts (e.g.,--#{$variable-prefix}body-color: #{$body-color};).