Styles can be added to a Svelte component in a <style>
tag. In practice, Svelte components have the style tag at the end of the file. Styles are scoped to the component.
Svelte by Example: Styles & CSS
Svelte supports <style>
tags to style components with scoped CSS.
In this example, we'll explore Svelte's styling options on a simplified Todo
component.
This will not affect the p
in Todo
because it's scoped to the current component.
Wrap a selector in :global
to add a global style that affects elements outside the component.
resources://
Further reading on this topic.