1 | # function-parentheses-space-inside
|
2 |
|
3 | Require a single space or disallow whitespace on the inside of the parentheses of functions.
|
4 |
|
5 |
|
6 | ```css
|
7 | a { transform: translate( 1, 1 ); }
|
8 | /** ↑ ↑
|
9 | * The space inside these two parentheses */
|
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 inside of the parentheses.
|
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 | ### `"never"`
|
42 |
|
43 | There _must never_ be whitespace on the inside of the parentheses.
|
44 |
|
45 | The following patterns are considered violations:
|
46 |
|
47 |
|
48 | ```css
|
49 | a { transform: translate( 1, 1 ); }
|
50 | ```
|
51 |
|
52 |
|
53 | ```css
|
54 | a { transform: translate(1, 1 ); }
|
55 | ```
|
56 |
|
57 | The following patterns are _not_ considered violations:
|
58 |
|
59 |
|
60 | ```css
|
61 | a { transform: translate(1, 1); }
|
62 | ```
|
63 |
|
64 | ### `"always-single-line"`
|
65 |
|
66 | There _must always_ be a single space inside the parentheses of single-line functions.
|
67 |
|
68 | The following patterns are considered violations:
|
69 |
|
70 |
|
71 | ```css
|
72 | a { transform: translate(1, 1) }
|
73 | ```
|
74 |
|
75 |
|
76 | ```css
|
77 | a { transform: translate(1, 1 ) }
|
78 | ```
|
79 |
|
80 | The following patterns are _not_ considered violations:
|
81 |
|
82 |
|
83 | ```css
|
84 | a { transform: translate( 1, 1 ) }
|
85 | ```
|
86 |
|
87 |
|
88 | ```css
|
89 | a { transform: translate(1,
|
90 | 1) }
|
91 | ```
|
92 |
|
93 |
|
94 | ```css
|
95 | a {
|
96 | transform: translate(
|
97 | 1,
|
98 | 1
|
99 | )
|
100 | }
|
101 | ```
|
102 |
|
103 | ### `"never-single-line"`
|
104 |
|
105 | There _must never_ be whitespace inside the parentheses of single-line functions.
|
106 |
|
107 | The following patterns are considered violations:
|
108 |
|
109 |
|
110 | ```css
|
111 | a { transform: translate( 1, 1 ) }
|
112 | ```
|
113 |
|
114 |
|
115 | ```css
|
116 | a { transform: translate(1, 1 ) }
|
117 | ```
|
118 |
|
119 | The following patterns are _not_ considered violations:
|
120 |
|
121 |
|
122 | ```css
|
123 | a { transform: translate(1, 1) }
|
124 | ```
|
125 |
|
126 |
|
127 | ```css
|
128 | a { transform: translate( 1,
|
129 | 1) }
|
130 | ```
|
131 |
|
132 |
|
133 | ```css
|
134 | a {
|
135 | transform: translate(
|
136 | 1,
|
137 | 1
|
138 | )
|
139 | }
|
140 | ```
|