Plugin for make styles in svelte-components global again
npm install --save-dev svelte-global-styles
or
npm i -D HeadMad/svelte-global-styles
// rollup.config.js
import svelte from 'rollup-plugin-svelte';
import globalStyles from 'svelte-global-styles';
...
export default {
...
plugins: [
svelte({
preprocess: [
globalStyles
],
...
})
]
}
If you whant use scoped styles in som files,
just add attribute scoped
to tag <style>
<style scoped>
/* Scoped styles */
</style>
If you don't planing use scope styles, you can use postcss plugin
called postcss-svelte-global-styles. But for this, you must use svelte plugin
like svelte-postcss
MIT