noInvalidDirectionInLinearGradient (CSS)
Language CSS
Summary
Section titled “Summary”- Rule available since:
v1.9.0 - Diagnostic Category:
lint/correctness/noInvalidDirectionInLinearGradient - This rule is recommended, meaning it is enabled by default.
- This rule doesn’t have a fix.
- The default severity of this rule is error.
- Sources:
How to configure
Section titled “How to configure”{ "linter": { "rules": { "correctness": { "noInvalidDirectionInLinearGradient": "error" } } }}Description
Section titled “Description”Disallow non-standard directions in linear gradients.
A gradient direction must be either an angle with a unit, such as 45deg, or a side or
corner preceded by to, such as to top or to bottom right. Writing only top or a
unitless number uses invalid or outdated syntax.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”.foo { background: linear-gradient(top, #fff, #000); }code-block.css:1:36 lint/correctness/noInvalidDirectionInLinearGradient ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unexpected nonstandard direction
> 1 │ .foo { background: linear-gradient(top, #fff, #000); }
│ ^^^
2 │
ℹ You should fix the direction value to follow the syntax.
ℹ See MDN web docs for more details.
.foo { background: linear-gradient(45, #fff, #000); }code-block.css:1:36 lint/correctness/noInvalidDirectionInLinearGradient ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unexpected nonstandard direction
> 1 │ .foo { background: linear-gradient(45, #fff, #000); }
│ ^^
2 │
ℹ You should fix the direction value to follow the syntax.
ℹ See MDN web docs for more details.
.foo { background: linear-gradient(to top, #fff, #000); }.foo { background: linear-gradient(45deg, #fff, #000); }Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.