0.0.2 • Published 3 days ago

css-variable-theme v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 days ago

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');
0.0.2

3 days ago

0.0.1

1 year ago