no-style-tag
What it does
Section titled “What it does”Reports a <style> element. A <style> inside a <template> is not reported.
Why it matters
Section titled “Why it matters”A stylesheet that is part of the page is sent again with every page, cannot be cached or shared, and is blocked by a strict content security policy.
To fix, move the rules to a file and use <link rel="stylesheet">.
Example
Section titled “Example”<head><style>p { color: red }</style><template><style>p {}</style></template></head>Configuration
Section titled “Configuration”angular: lint: rules: no-style-tag: warn # off (default), warn, errorhtml: lint: rules: no-style-tag: warn # off (default), warn, errorsvelte: lint: rules: no-style-tag: warn # off (default), warn, errorvue: lint: rules: no-style-tag: warn # off (default), warn, errorEnabled by the presets: html/htmlhint.
Suppress one line with sudsy-disable-next-line no-style-tag in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| html-validate | no-style-tag |
full |
| htmlhint | style-disabled |
full |