In the original , the background color is based on the , but in the it is based on the . It is set by the modified mixin, to use the function to set the background and color style, and the SCSS variable is used to add the color property light-color the same way by checking whether the lightness of the SCSS variable is below 60.
For example to add .bg-accent CSS class color that uses CSS variable accent-color.
// Get bg-color-variant mixin
@use 'node_modules/@angular-package/spectre.css/src/mixins/color' as *;
@use 'node_modules/@angular-package/spectre.css/variables' as *;
// Include
@include bg-color-variant('.bg-accent', 'accent-color', $accent-color);
Naming consistency
All colors have equivalent background CSS classes even with dark and light shades. backgrounds are using the same SCSS variable name as the class name except one .bg-gray, which uses $bg-color. version modified it, now $bg-color SASS variable is used in the new background .bg and .bg-bg class, and .bg-gray uses $gray-color to have consistent naming. The class name does not include suffix color, but there is one exception in the .bg-color, which includes.
It's because of the SCSS variable $bg-color below, its shades, and treating prefix bg like not a color name, but it is the color name.
If I want to create background CSS class color .bg-dark, it should refer to the SCSS variable $dark-color to preserve naming consistency, but it can refer also to the $bg-color-dark with losing consistency. In the beta version, I decided to add the .bg-bg background class name to have full naming consistency, so the non-consistent .bg-color is treated as deprecated.
Let's look at how CSS background class colors finally are defined.