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