UNPKG

1.36 kBMarkdownView Raw
1# declaration-colon-newline-after
2
3Require a newline or disallow whitespace after the colon of declarations.
4
5<!-- prettier-ignore -->
6```css
7a {
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
16The [`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
24There _must always_ be a newline after the colon.
25
26The following patterns are considered violations:
27
28<!-- prettier-ignore -->
29```css
30a { color:pink; }
31```
32
33<!-- prettier-ignore -->
34```css
35a { color: pink; }
36```
37
38The following patterns are _not_ considered violations:
39
40<!-- prettier-ignore -->
41```css
42a {
43 color:
44 pink;
45}
46```
47
48### `"always-multi-line"`
49
50There _must always_ be a newline after the colon _if the declaration's value is multi-line_.
51
52The following patterns are considered violations:
53
54<!-- prettier-ignore -->
55```css
56a {
57 box-shadow: 0 0 0 1px #5b9dd9,
58 0 0 2px 1px rgba(30, 140, 190, 0.8);
59}
60```
61
62The following patterns are _not_ considered violations:
63
64<!-- prettier-ignore -->
65```css
66a {
67 box-shadow:
68 0 0 0 1px #5b9dd9,
69 0 0 2px 1px rgba(30, 140, 190, 0.8);
70}
71```
72
73<!-- prettier-ignore -->
74```css
75a {
76 color: pink;
77}
78```