Ir al contenido

useScopedStyles

Esta página aún no está disponible en tu idioma.

biome.json
{
"linter": {
"rules": {
"nursery": {
"useScopedStyles": "error"
}
}
}
}

Enforce that <style> blocks in Vue SFCs have the scoped attribute and that <style> blocks in Astro components do not have the is:global directive.

Vue’s scoped attribute automatically scopes CSS to the component, preventing style leakage and conflicts. Astro’s is:global attribute allows for global styles, but without it, styles are scoped to the component by default.

Style blocks with the module attribute are exempt, as CSS Modules is an alternative scoping mechanism.

<style>
.foo { color: red; }
</style>
<style is:global>
.foo { color: red; }
</style>
<style scoped>
.foo { color: red; }
</style>
<style module>
.foo { color: red; }
</style>