Blade Components uses a simple background and foreground convention for colors. The background suffix is omitted when the variable is used for the background color of a component.
Using this convention for the primary color this would result in the following CSS variables:
All components use a fixed set of variables. These variables are defined in a PHP enum and together with the theme class processed by Blade Colors during runtime.
Themes are defined in theme classes, which contain a collection of CSS variables, most commonly, for 2 theme variants, light and dark.
Out of the box Blade Colors loads the "default theme" automatically. The default theme contains a variety of common CSS variable definitions used by Blade Components, including 2 theme variants, light and dark.
During runtime the theme variants will be rendered within 2 generic CSS selectors :root {} and .dark {}.
Custom Blade Color theme classes must implement the DistortedFusion\BladeColors\Contracts\ThemeContract interface.
When creating a custom theme for Blade Components you're not required to define all possible CSS variables manually. Instead you can simply refer to the default theme and alter the variables you want customized.
After creating your custom theme, or when using one of the provided color variants, you need to set the default theme within your AppServiceProvider using the BladeColors::setDefaultTheme() method.
If you're planning on supporting multiple themes at once, themes should be added using a custom selector. When using a custom selector all registered themes are available simultaneously and wont require a complete page reload when switching between themes.
Note
Themes applied trough custom selectors do not require to implement all available CSS variables and could be used to stack CSS variables across themes.
To register a theme using a custom selector you need to call the BladeColors::registerTheme() method from your AppServiceProvider.