.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / rules / block-opening-brace-newline-before / README.md
1 # block-opening-brace-newline-before
2
3 Require a newline or disallow whitespace before the opening brace of blocks.
4
5 ```css
6   a
7     { color: pink; }
8 /** ↑
9  * The newline before this brace */
10 ```
11
12 Refer to [the FAQ](../../../docs/user-guide/faq.md#how-do-i-disallow-single-line-blocks) for more information on using this rule with [`block-opening-brace-newline-after`](../block-opening-brace-newline-after/README.md) to disallow single-line rules.
13
14 ## Options
15
16 `string`: `"always"|"always-single-line"|"never-single-line"|"always-multi-line"|"never-multi-line"`
17
18 ### `"always"`
19
20 There *must always* be a newline before the opening brace.
21
22 The following patterns are considered violations:
23
24 ```css
25 a{ color: pink; }
26 ```
27
28 ```css
29 a{ color: pink;
30 }
31 ```
32
33 The following patterns are *not* considered violations:
34
35 ```css
36 a
37 { color: pink; }
38 ```
39
40 ```css
41 a
42 {
43 color: pink; }
44 ```
45
46 ```css
47 a /* foo */
48   {
49     color: pink;
50   }
51 ```
52
53 ### `"always-single-line"`
54
55 There *must always* be a newline before the opening brace in single-line blocks.
56
57 The following patterns are considered violations:
58
59 ```css
60 a{ color: pink; }
61 ```
62
63 The following patterns are *not* considered violations:
64
65 ```css
66 a
67 { color: pink; }
68 ```
69
70 ```css
71 a{
72 color: pink; }
73 ```
74
75 ### `"never-single-line"`
76
77 There *must never* be whitespace before the opening brace in single-line blocks.
78
79 The following patterns are considered violations:
80
81 ```css
82 a { color: pink; }
83 ```
84
85 The following patterns are *not* considered violations:
86
87 ```css
88 a{ color: pink; }
89 ```
90
91 ```css
92 a {
93 color: pink; }
94 ```
95
96 ### `"always-multi-line"`
97
98 There *must always* be a newline before the opening brace in multi-line blocks.
99
100 The following patterns are considered violations:
101
102 ```css
103 a{
104 color: pink; }
105 ```
106
107 ```css
108 a {
109 color: pink; }
110 ```
111
112 The following patterns are *not* considered violations:
113
114 ```css
115 a{ color: pink; }
116 ```
117
118 ```css
119 a { color: pink; }
120 ```
121
122 ```css
123 a
124 { color: pink; }
125 ```
126
127 ```css
128 a
129 {
130 color: pink; }
131 ```
132
133 ### `"never-multi-line"`
134
135 There *must never* be whitespace before the opening brace in multi-line blocks.
136
137 The following patterns are considered violations:
138
139 ```css
140 a {
141 color: pink; }
142 ```
143
144 The following patterns are *not* considered violations:
145
146 ```css
147 a { color: pink; }
148 ```
149
150 ```css
151 a{
152 color: pink;}
153 ```