.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / rules / function-linear-gradient-no-nonstandard-direction / README.md
1 # function-linear-gradient-no-nonstandard-direction
2
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).
5
6 ```css
7 .foo { background: linear-gradient(to top, #fff, #000); }
8 /**                                ↑
9  * This (optional) first argument is the "direction" */
10 ```
11
12 A valid and standard direction value is one of the following:
13
14 -   an angle
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.)
16
17 A common mistake (matching outdated non-standard syntax) is to use just a side-or-corner without the preceding `to`.
18
19 ## Options
20
21 ### `true`
22
23 The following patterns are considered violations:
24
25 ```css
26 .foo { background: linear-gradient(top, #fff, #000); }
27 ```
28
29 ```css
30 .foo { background: linear-gradient(bottom, #fff, #000); }
31 ```
32
33 ```css
34 .foo { background: linear-gradient(left, #fff, #000); }
35 ```
36
37 ```css
38 .foo { background: linear-gradient(45, #fff, #000); }
39 ```
40
41 ```css
42 .foo { background: linear-gradient(to top top, #fff, #000); }
43 ```
44
45 The following patterns are *not* considered violations:
46
47 ```css
48 .foo { background: linear-gradient(to top, #fff, #000); }
49 ```
50
51 ```css
52 .foo { background: linear-gradient(to bottom right, #fff, #000); }
53 ```
54
55 ```css
56 .foo { background: linear-gradient(45deg, #fff, #000); }
57 ```
58
59 ```css
60 .foo { background: linear-gradient(1.57rad, #fff, #000); }
61 ```
62
63 ```css
64 /* Direction defaults to "to bottom" */
65 .foo { background: linear-gradient(#fff, #000); }
66 ```