css-variable-theme
v0.0.2
Published
Use css variables to change theme elegantly.
Downloads
3
Readme
css-variable-theme
install
yarn add css-variable-theme
use
import { registerThemes } from 'css-variable-theme';
registerThemes({
// light theme and its css variables
light: {
"--bg": "#fff",
"--color": "#333"
},
dark: {
"--bg": "#555",
"--color": "#eee"
}
});
xxx.css
.demo {
background: var(--bg);
color: var(--color);
}
another.js
import { setTheme } from 'css-variable-theme';
setTheme('light');