1 | # function-whitelist
|
2 |
|
3 | **_Deprecated: Instead use the [`function-allowed-list`](../function-allowed-list/README.md) rule._**
|
4 |
|
5 | Specify a list of allowed functions.
|
6 |
|
7 |
|
8 | ```css
|
9 | a { transform: scale(1); }
|
10 | /** ↑
|
11 | * This function */
|
12 | ```
|
13 |
|
14 | ## Options
|
15 |
|
16 | `array|string`: `["array", "of", "unprefixed", /functions/ or "regex"]|"function"|"/regex/"`
|
17 |
|
18 | If a string is surrounded with `"/"` (e.g. `"/^rgb/"`), it is interpreted as a regular expression.
|
19 |
|
20 | Given:
|
21 |
|
22 | ```
|
23 | ["scale", "rgba", "linear-gradient"]
|
24 | ```
|
25 |
|
26 | The following patterns are considered violations:
|
27 |
|
28 |
|
29 | ```css
|
30 | a { transform: rotate(1); }
|
31 | ```
|
32 |
|
33 |
|
34 | ```css
|
35 | a {
|
36 | color: hsla(170, 50%, 45%, 1)
|
37 | }
|
38 | ```
|
39 |
|
40 |
|
41 | ```css
|
42 | a {
|
43 | background:
|
44 | red,
|
45 | -webkit-radial-gradient(red, green, blue);
|
46 | }
|
47 | ```
|
48 |
|
49 | The following patterns are _not_ considered violations:
|
50 |
|
51 |
|
52 | ```css
|
53 | a { background: red; }
|
54 | ```
|
55 |
|
56 |
|
57 | ```css
|
58 | a { transform: scale(1); }
|
59 | ```
|
60 |
|
61 |
|
62 | ```css
|
63 | a {
|
64 | color: rgba(0, 0, 0, 0.5);
|
65 | }
|
66 | ```
|
67 |
|
68 |
|
69 | ```css
|
70 | a {
|
71 | background:
|
72 | red,
|
73 | -moz-linear-gradient(45deg, blue, red);
|
74 | }
|
75 | ```
|