4
4
5
5
ul ,
6
6
ol {
7
- margin-block : 1rem ;
8
- padding-inline-start : 2.4em ;
7
+ margin-block : 1rem ;
8
+ padding-inline-start : 2.4em ;
9
9
10
- li {
11
- max-inline-size : rem ($text-measure );
12
- }
10
+ li {
11
+ max-inline-size : rem ($text-measure );
12
+ }
13
13
14
- li + li {
15
- margin-block-start : 0.75rem ;
16
- }
14
+ li + li {
15
+ margin-block-start : 0.75rem ;
16
+ }
17
17
}
18
18
19
19
ol .counter {
20
- ::marker {
21
- content : counters (list-item , " ." ) " . " ;
22
- }
20
+ ::marker {
21
+ content : counters (list-item , " ." ) " . " ;
22
+ }
23
23
}
24
24
25
25
26
26
/* *
27
- Remove bullets, margin and padding from lists inside a <nav> element, and lists with the
28
- '.clean-list' class/. Note that that this may remove list semantics in some circumstances in
29
- some WebKit browsers. See https://www.scottohara.me/blog/2019/01/12/lists-and-safari.html
27
+ Remove bullets, margin and padding from lists inside a <nav> element.
28
+ Note that that this may remove list semantics in some circumstances in some
29
+ WebKit browsers. See https://www.scottohara.me/blog/2019/01/12/lists-and-safari.html
30
30
If it's important that the number of items in a list is announced, add role="list" to the <ul> / <ol>
31
31
*/
32
- nav ul ,
33
- nav ol ,
34
- .clean-list {
32
+ nav :is(ul , ol ) {
35
33
list-style : none ;
36
34
margin : 0 ;
37
35
padding : 0 ;
@@ -44,78 +42,88 @@ nav ol,
44
42
}
45
43
}
46
44
45
+ /* *
46
+ Remove bullets from lists with the `.clean-list, class.
47
+ Note that that this may remove list semantics in some circumstances in some
48
+ WebKit browsers. See https://www.scottohara.me/blog/2019/01/12/lists-and-safari.html
49
+ If it's important that the number of items in a list is announced, add role="list" to the <ul> / <ol>
50
+ */
51
+ .clean-list {
52
+ list-style : none ;
53
+ }
54
+
47
55
48
56
/* *
49
57
Description lists / Definition lists
50
58
*/
51
59
dl {
52
- margin-block : 1rem ;
53
- max-inline-size : rem ($text-measure );
60
+ margin-block : 1rem ;
61
+ max-inline-size : rem ($text-measure );
54
62
55
- dt {
56
- font-weight : bold ;
57
- }
63
+ dt {
64
+ font-weight : bold ;
65
+ }
58
66
59
67
dd {
60
68
margin-inline-start : rem (40 );
61
69
}
62
70
63
- dd + dt {
64
- margin-block-start : 0.5em ;
65
- }
71
+ dd + dt {
72
+ margin-block-start : 0.5em ;
73
+ }
66
74
67
- dt + dd ,
68
- dd + dd {
69
- margin-block-start : 0.25em ;
70
- }
75
+ dt + dd ,
76
+ dd + dd {
77
+ margin-block-start : 0.25em ;
78
+ }
71
79
}
72
80
73
81
// display items on the same line (comma-separated)
74
82
dl .inline {
75
- div {
76
- align-items : baseline ;
77
- display : flex ;
78
- flex-wrap : wrap ;
79
-
80
- dt , dd {
81
- margin-inline-start : 0 ;
82
- }
83
-
84
- dt ::after {
85
- content : " :\00a0 " ;
86
- }
87
-
88
- dd :not (:last-child ):after {
89
- content : ' ,\00a0 ' ;
90
- }
91
- }
83
+ div {
84
+ align-items : baseline ;
85
+ display : flex ;
86
+ flex-wrap : wrap ;
87
+
88
+ dt , dd {
89
+ margin-inline-start : 0 ;
90
+ }
91
+
92
+ dt ::after {
93
+ content : " :\00a0 " ;
94
+ }
95
+
96
+ dd :not (:last-child ):after {
97
+ content : ' ,\00a0 ' ;
98
+ }
99
+ }
92
100
}
93
101
94
102
// With a grid layout for a more tabulated feel
95
103
96
104
dl .grid {
97
- @supports (grid-row-start : auto ) {
98
- column-gap : 1rem ;
99
- display : grid ;
100
- grid-template-columns : max-content ;
101
- grid-template-rows : 1fr ;
102
- row-gap : 1rem ;
103
-
104
- dd + dt ,
105
- dt + dd ,
106
- dd + dd {
107
- margin-block-start : 0 ;
108
- }
109
-
110
- dt {
111
- grid-column-start : 1 ;
112
- grid-column-end : 2 ;
113
- }
114
-
115
- dd {
116
- grid-column-start : 2 ;
117
- grid-column-end : 3 ;
105
+ @supports (grid-row-start : auto ) {
106
+ column-gap : 1rem ;
107
+ display : grid ;
108
+ grid-template-columns : max-content ;
109
+ grid-template-rows : 1fr ;
110
+ row-gap : 1rem ;
111
+
112
+ dd + dt ,
113
+ dt + dd ,
114
+ dd + dd {
115
+ margin-block-start : 0 ;
116
+ }
117
+
118
+ dt {
119
+ grid-column-start : 1 ;
120
+ grid-column-end : 2 ;
121
+ }
122
+
123
+ dd {
124
+ grid-column-start : 2 ;
125
+ grid-column-end : 3 ;
118
126
margin-inline-start : 0 ;
119
- }
120
- }
127
+ }
128
+ }
121
129
}
0 commit comments