Description
Add support flexible themes for svelte components.
You can use this plugin with rollup-plugin-svelte: svelte({ preprocessor: ... })
Plugin support these CSS syntaxes: scss
, less
, stylus
, js
Install
npm i postcss postcss-import node-sass svelte-preprocess svelte-themes-preprocess --save-dev
How it work
theme_dark.scss
:global(.theme_dark)
theme_light.scss
:global(.theme_light)
themes.scss
;;
component.svelte
Svelte component
Preprocessing
const postcssOptions = plugins: // This plugin is necessary and should be first in plugins list: // Other plugins ... const sveltePreprocess = const result = svelte
Result
Svelte component