This rule reports a variant that replaces the element with a document-wide
target, such as [:root]:. Stillwind compiles CSS statically, so including this
declaration in your code affects the document even when the element is not
rendered.
Reported
style("[:root]:text-red-500");document-scoped-selector: `:root` does not depend on the styled element; declare document-wide CSS in a global stylesheetFixed
:root {
@apply text-red-500;
}How to fix
- To style the root of the page, write a rule in your stylesheet, as in the example.
- To style the element itself, remove the variant:
style("text-red-500").
Rule settings
| Preset | Severity |
|---|---|
recommended | deny |
strict | deny |
stylistic | off |
Configure lint to change the severity or options.