Svelte · Senior · Question 53 of 75
How does scoping CSS work, and what are its limits?
- ✓Correct answer: The compiler adds a hash class to matching elements and selectors; it can't style elements created by
{@html}or inside child components without:global - 2Styles are put in Shadow DOM
- 3Styles are inlined into each element
Explanation
Scoped selectors get extra specificity from the hash class. Custom elements mode uses Shadow DOM instead.