UNPKG

1.21 kBMarkdownView Raw
1# declaration-colon-newline-after
2
3Require a newline or disallow whitespace after the colon of declarations.
4
5```css
6a {
7 box-shadow:
8 0 0 0 1px #5b9dd9,
9 0 0 2px 1px rgba(30, 140, 190, 0.8);
10} /* ↑ */
11/** ↑
12 * The newline after this colon */
13```
14
15The `--fix` option on the [command line](../../../docs/user-guide/cli.md#autofixing-errors) can automatically fix all of the problems reported by this rule.
16
17## Options
18
19`string`: `"always"|"always-multi-line"`
20
21### `"always"`
22
23There *must always* be a newline after the colon.
24
25The following patterns are considered violations:
26
27```css
28a { color:pink; }
29```
30
31```css
32a { color: pink; }
33```
34
35The following patterns are *not* considered violations:
36
37```css
38a {
39 color:
40 pink;
41}
42```
43
44### `"always-multi-line"`
45
46There *must always* be a newline after the colon *if the declaration's value is multi-line*.
47
48The following patterns are considered violations:
49
50```css
51a {
52 box-shadow: 0 0 0 1px #5b9dd9,
53 0 0 2px 1px rgba(30, 140, 190, 0.8);
54}
55```
56
57The following patterns are *not* considered violations:
58
59```css
60a {
61 box-shadow:
62 0 0 0 1px #5b9dd9,
63 0 0 2px 1px rgba(30, 140, 190, 0.8);
64}
65```
66
67```css
68a {
69 color: pink;
70}
71```