1 | # function-comma-space-after
|
2 |
|
3 | Require a single space or disallow whitespace after the commas of functions.
|
4 |
|
5 |
|
6 | ```css
|
7 | a { transform: translate(1, 1) }
|
8 | /** ↑
|
9 | * The space after this comma */
|
10 | ```
|
11 |
|
12 | The [`fix` option](../../../docs/user-guide/usage/options.md#fix) can automatically fix all of the problems reported by this rule.
|
13 |
|
14 | ## Options
|
15 |
|
16 | `string`: `"always"|"never"|"always-single-line"|"never-single-line"`
|
17 |
|
18 | ### `"always"`
|
19 |
|
20 | There _must always_ be a single space after the commas.
|
21 |
|
22 | The following patterns are considered violations:
|
23 |
|
24 |
|
25 | ```css
|
26 | a { transform: translate(1,1) }
|
27 | ```
|
28 |
|
29 |
|
30 | ```css
|
31 | a { transform: translate(1 ,1) }
|
32 | ```
|
33 |
|
34 | The following patterns are _not_ considered violations:
|
35 |
|
36 |
|
37 | ```css
|
38 | a { transform: translate(1, 1) }
|
39 | ```
|
40 |
|
41 |
|
42 | ```css
|
43 | a { transform: translate(1 , 1) }
|
44 | ```
|
45 |
|
46 | ### `"never"`
|
47 |
|
48 | There _must never_ be whitespace after the commas.
|
49 |
|
50 | The following patterns are considered violations:
|
51 |
|
52 |
|
53 | ```css
|
54 | a { transform: translate(1, 1) }
|
55 | ```
|
56 |
|
57 |
|
58 | ```css
|
59 | a { transform: translate(1 , 1) }
|
60 | ```
|
61 |
|
62 | The following patterns are _not_ considered violations:
|
63 |
|
64 |
|
65 | ```css
|
66 | a { transform: translate(1,1) }
|
67 | ```
|
68 |
|
69 |
|
70 | ```css
|
71 | a { transform: translate(1 ,1) }
|
72 | ```
|
73 |
|
74 | ### `"always-single-line"`
|
75 |
|
76 | There _must always_ be a single space after the commas in single-line functions.
|
77 |
|
78 | The following patterns are considered violations:
|
79 |
|
80 |
|
81 | ```css
|
82 | a { transform: translate(1,1) }
|
83 | ```
|
84 |
|
85 |
|
86 | ```css
|
87 | a { transform: translate(1 ,1) }
|
88 | ```
|
89 |
|
90 | The following patterns are _not_ considered violations:
|
91 |
|
92 |
|
93 | ```css
|
94 | a { transform: translate(1, 1) }
|
95 | ```
|
96 |
|
97 |
|
98 | ```css
|
99 | a { transform: translate(1 , 1) }
|
100 | ```
|
101 |
|
102 |
|
103 | ```css
|
104 | a {
|
105 | transform: translate(1
|
106 | ,1)
|
107 | }
|
108 | ```
|
109 |
|
110 | ### `"never-single-line"`
|
111 |
|
112 | There _must never_ be whitespace after the commas in single-line functions.
|
113 |
|
114 | The following patterns are considered violations:
|
115 |
|
116 |
|
117 | ```css
|
118 | a { transform: translate(1, 1) }
|
119 | ```
|
120 |
|
121 |
|
122 | ```css
|
123 | a { transform: translate(1 , 1) }
|
124 | ```
|
125 |
|
126 | The following patterns are _not_ considered violations:
|
127 |
|
128 |
|
129 | ```css
|
130 | a { transform: translate(1,1) }
|
131 | ```
|
132 |
|
133 |
|
134 | ```css
|
135 | a { transform: translate(1 ,1) }
|
136 | ```
|
137 |
|
138 |
|
139 | ```css
|
140 | a {
|
141 | transform: translate(1
|
142 | , 1)
|
143 | }
|
144 | ```
|