.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / rules / font-weight-notation / README.md
1 # font-weight-notation
2
3 Require numeric or named (where possible) `font-weight` values. Also, when named values are expected, require only valid names.
4
5 ```css
6 a { font-weight: bold }
7 /**              ↑
8  *   This notation */
9
10 a { font: italic small-caps 600 16px/3 cursive; }
11 /**                         ↑
12 *      And this notation, too */
13 ```
14
15 Valid font-weight names are `normal`, `bold`, `bolder`, and `lighter`.
16
17 This rule ignores `$sass`, `@less`, and `var(--custom-property)` variable syntaxes.
18
19 ## Options
20
21 `string`: `"numeric"|"named-where-possible"`
22
23 ### `"numeric"`
24
25 `font-weight` values *must always* be numbers.
26
27 The following patterns are considered violations:
28
29 ```css
30 a { font-weight: bold; }
31 ```
32
33 ```css
34 a { font: italic normal 20px; }
35 ```
36
37 The following patterns are *not* considered violations:
38
39 ```css
40 a { font-weight: 700; }
41 ```
42
43 ```css
44 a { font: italic 900 20px; }
45 ```
46
47 ### `"named-where-possible"`
48
49 `font-weight` values *must always* be keywords when an appropriate keyword is available.
50
51 This means that only `400` and `700` will be rejected, because those are the only numbers with keyword equivalents (`normal` and `bold`).
52
53 The following patterns are considered violations:
54
55 ```css
56 a { font-weight: 700; }
57 ```
58
59 ```css
60 a { font: italic 400 20px; }
61 ```
62
63 The following patterns are *not* considered violations:
64
65 ```css
66 a { font-weight: bold; }
67 ```
68
69 ```css
70 a { font: italic normal 20px; }
71 ```
72
73 ## Optional secondary options
74
75 ### `ignore: ["relative"]`
76
77 Ignore the [*relative*](https://drafts.csswg.org/css-fonts/#font-weight-prop) keyword names of `bolder` and `lighter`.
78
79 The following patterns are *not* considered violations:
80
81 ```css
82 a { font-weight: 400; }
83 a b { font-weight: lighter; }
84 ```