In the original Spectre.css, the background color is based on the SCSS variable, but in the @angular-package/spectre.css it is based on the CSS variable. It is set by the modified bg-color-variant() mixin, to use the color() 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@includebg-color-variant('.bg-accent', 'accent-color', $accent-color);
Naming consistency
All colors have equivalent background CSS classes even with dark and light shades. Spectre.css backgrounds are using the same SCSS variable name as the class name except one .bg-gray, which uses $bg-color. @angular-package/spectre.css 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.