Svelte is a front-end framework for web development, you can find more about it here. This post is about using CSS in Svelte.
CSS in Svelte Components
CSS styles specified in Svelte components are scoped to the component itself, meaning they don’t affect anything outside the component. Svelte compiler achieves this by making appropriate changes to the CSS and HTML.
It also bundles and minifies CSS from all the components into a single CSS file called ‘bundle.css’. Moreover, any unused styles are purged with along with compiler warnings.
Sharing styles from components
We can use ‘global’ keyword to avoid the styles being scoped to the components.