1 # function-linear-gradient-no-nonstandard-direction
3 Disallow direction values in `linear-gradient()` calls that are not valid according to the
4 [standard syntax](https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient#Syntax).
7 .foo { background: linear-gradient(to top, #fff, #000); }
9 * This (optional) first argument is the "direction" */
12 A valid and standard direction value is one of the following:
15 - `to ` plus a side-or-corner (`to top`, `to bottom`, `to left`, `to right`; `to top right`, `to right top`, `to bottom left`, etc.)
17 A common mistake (matching outdated non-standard syntax) is to use just a side-or-corner without the preceding `to`.
23 The following patterns are considered violations:
26 .foo { background: linear-gradient(top, #fff, #000); }
30 .foo { background: linear-gradient(bottom, #fff, #000); }
34 .foo { background: linear-gradient(left, #fff, #000); }
38 .foo { background: linear-gradient(45, #fff, #000); }
42 .foo { background: linear-gradient(to top top, #fff, #000); }
45 The following patterns are *not* considered violations:
48 .foo { background: linear-gradient(to top, #fff, #000); }
52 .foo { background: linear-gradient(to bottom right, #fff, #000); }
56 .foo { background: linear-gradient(45deg, #fff, #000); }
60 .foo { background: linear-gradient(1.57rad, #fff, #000); }
64 /* Direction defaults to "to bottom" */
65 .foo { background: linear-gradient(#fff, #000); }