UNPKG

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