CSS-variables-based swappable themes for Tailwind CSS
0,0,0,.5,.5
instead of 0,0,0,.5
)..variable('name', 'value', 'tailwindConfigurationItem')
.variable(name, value)
to add a custom property to a themeExample
The following theme configuration:
new Theme()
.color('primary', 'white')
.variable('theme-scheme', 'light')
.variable('font-title', ['Roboto', '"Segoe UI"', 'Arial']);
Will generate:
:root {
--color-primary: #ffffff;
--theme-scheme: light;
--font-title: Roboto,"Segoe UI",Arial;
}
#ffffff00
would be white)#ffffff00
will be transparent)Note: v2.0.1 actually contains these changes, but v2.0.2 fixes a typo in them.
.default()
ThemeBuilder
is now more fluent.dark()
and .light()
helpers in ThemeBuilder
.schemeDefault()
, replaced by existing .default()
.keep()
, replaced by .assignable()