1 | # declaration-colon-newline-after
|
2 |
|
3 | Require a newline or disallow whitespace after the colon of declarations.
|
4 |
|
5 | ```css
|
6 | a {
|
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 |
|
15 | The `--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 |
|
23 | There *must always* be a newline after the colon.
|
24 |
|
25 | The following patterns are considered violations:
|
26 |
|
27 | ```css
|
28 | a { color:pink; }
|
29 | ```
|
30 |
|
31 | ```css
|
32 | a { color: pink; }
|
33 | ```
|
34 |
|
35 | The following patterns are *not* considered violations:
|
36 |
|
37 | ```css
|
38 | a {
|
39 | color:
|
40 | pink;
|
41 | }
|
42 | ```
|
43 |
|
44 | ### `"always-multi-line"`
|
45 |
|
46 | There *must always* be a newline after the colon *if the declaration's value is multi-line*.
|
47 |
|
48 | The following patterns are considered violations:
|
49 |
|
50 | ```css
|
51 | a {
|
52 | box-shadow: 0 0 0 1px #5b9dd9,
|
53 | 0 0 2px 1px rgba(30, 140, 190, 0.8);
|
54 | }
|
55 | ```
|
56 |
|
57 | The following patterns are *not* considered violations:
|
58 |
|
59 | ```css
|
60 | a {
|
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
|
68 | a {
|
69 | color: pink;
|
70 | }
|
71 | ```
|