@teseor/css 1.4.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiled.css +1 -1
- package/dist/index.css +22 -0
- package/package.json +1 -1
- package/src/04-components/actions/close-button/close-button-visual.png +0 -0
- package/src/04-components/actions/close-button/close-button.api.json +71 -0
- package/src/04-components/actions/close-button/close-button.docs.json +264 -0
- package/src/04-components/actions/close-button/close-button.visual.spec.ts +14 -0
- package/src/04-components/actions/close-button/index.scss +101 -0
- package/src/04-components/data-display/image/image-visual.png +0 -0
- package/src/04-components/data-display/image/image.api.json +76 -0
- package/src/04-components/data-display/image/image.docs.json +337 -0
- package/src/04-components/data-display/image/image.visual.spec.ts +14 -0
- package/src/04-components/data-display/image/index.scss +103 -0
- package/src/04-components/feedback/progress-circle/index.scss +92 -0
- package/src/04-components/feedback/progress-circle/progress-circle-visual.png +0 -0
- package/src/04-components/feedback/progress-circle/progress-circle.api.json +53 -0
- package/src/04-components/feedback/progress-circle/progress-circle.docs.json +377 -0
- package/src/04-components/feedback/progress-circle/progress-circle.visual.spec.ts +14 -0
- package/src/04-components/forms/checkbox-group/checkbox-group-visual.png +0 -0
- package/src/04-components/forms/checkbox-group/checkbox-group.api.json +54 -0
- package/src/04-components/forms/checkbox-group/checkbox-group.docs.json +338 -0
- package/src/04-components/forms/checkbox-group/checkbox-group.visual.spec.ts +14 -0
- package/src/04-components/forms/checkbox-group/index.scss +84 -0
- package/src/04-components/forms/fieldset/fieldset-visual.png +0 -0
- package/src/04-components/forms/fieldset/fieldset.api.json +49 -0
- package/src/04-components/forms/fieldset/fieldset.docs.json +520 -0
- package/src/04-components/forms/fieldset/fieldset.visual.spec.ts +14 -0
- package/src/04-components/forms/fieldset/index.scss +69 -0
- package/src/04-components/forms/form/form-visual.png +0 -0
- package/src/04-components/forms/form/form.api.json +38 -0
- package/src/04-components/forms/form/form.docs.json +482 -0
- package/src/04-components/forms/form/form.visual.spec.ts +14 -0
- package/src/04-components/forms/form/index.scss +62 -0
- package/src/04-components/forms/radio-group/index.scss +84 -0
- package/src/04-components/forms/radio-group/radio-group-visual.png +0 -0
- package/src/04-components/forms/radio-group/radio-group.api.json +54 -0
- package/src/04-components/forms/radio-group/radio-group.docs.json +350 -0
- package/src/04-components/forms/radio-group/radio-group.visual.spec.ts +14 -0
- package/src/04-components/forms/search-input/index.scss +172 -0
- package/src/04-components/forms/search-input/search-input-visual.png +0 -0
- package/src/04-components/forms/search-input/search-input.api.json +85 -0
- package/src/04-components/forms/search-input/search-input.docs.json +257 -0
- package/src/04-components/forms/search-input/search-input.visual.spec.ts +14 -0
- package/src/04-components/forms/slider/index.scss +153 -0
- package/src/04-components/forms/slider/slider-visual.png +0 -0
- package/src/04-components/forms/slider/slider.api.json +70 -0
- package/src/04-components/forms/slider/slider.docs.json +144 -0
- package/src/04-components/forms/slider/slider.visual.spec.ts +14 -0
- package/src/04-components/index.scss +11 -0
- package/src/04-components/typography/code-block/code-block-visual.png +0 -0
- package/src/04-components/typography/code-block/code-block.api.json +56 -0
- package/src/04-components/typography/code-block/code-block.docs.json +289 -0
- package/src/04-components/typography/code-block/code-block.visual.spec.ts +14 -0
- package/src/04-components/typography/code-block/index.scss +87 -0
- package/src/04-components/typography/list/index.scss +65 -0
- package/src/04-components/typography/list/list-visual.png +0 -0
- package/src/04-components/typography/list/list.api.json +33 -0
- package/src/04-components/typography/list/list.docs.json +293 -0
- package/src/04-components/typography/list/list.visual.spec.ts +14 -0
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
@forward './actions/button/index';
|
|
2
2
|
@forward './actions/button-group/index';
|
|
3
|
+
@forward './actions/close-button/index';
|
|
3
4
|
@forward './data-display/avatar/index';
|
|
4
5
|
@forward './data-display/badge/index';
|
|
5
6
|
@forward './data-display/card/index';
|
|
6
7
|
@forward './data-display/data-list/index';
|
|
7
8
|
@forward './data-display/icon/index';
|
|
9
|
+
@forward './data-display/image/index';
|
|
8
10
|
@forward './data-display/stat/index';
|
|
9
11
|
@forward './data-display/status/index';
|
|
10
12
|
@forward './data-display/table/index';
|
|
@@ -13,17 +15,24 @@
|
|
|
13
15
|
@forward './disclosure/disclosure/index';
|
|
14
16
|
@forward './feedback/alert/index';
|
|
15
17
|
@forward './feedback/progress/index';
|
|
18
|
+
@forward './feedback/progress-circle/index';
|
|
16
19
|
@forward './feedback/skeleton/index';
|
|
17
20
|
@forward './feedback/spinner/index';
|
|
18
21
|
@forward './feedback/toast/index';
|
|
19
22
|
@forward './forms/checkbox/index';
|
|
23
|
+
@forward './forms/checkbox-group/index';
|
|
20
24
|
@forward './forms/field/index';
|
|
25
|
+
@forward './forms/fieldset/index';
|
|
26
|
+
@forward './forms/form/index';
|
|
21
27
|
@forward './forms/form-error/index';
|
|
22
28
|
@forward './forms/form-helper/index';
|
|
23
29
|
@forward './forms/input/index';
|
|
24
30
|
@forward './forms/label/index';
|
|
25
31
|
@forward './forms/radio/index';
|
|
32
|
+
@forward './forms/radio-group/index';
|
|
33
|
+
@forward './forms/search-input/index';
|
|
26
34
|
@forward './forms/select/index';
|
|
35
|
+
@forward './forms/slider/index';
|
|
27
36
|
@forward './forms/textarea/index';
|
|
28
37
|
@forward './forms/toggle/index';
|
|
29
38
|
@forward './layout/divider/index';
|
|
@@ -41,7 +50,9 @@
|
|
|
41
50
|
@forward './overlays/tooltip/index';
|
|
42
51
|
@forward './typography/blockquote/index';
|
|
43
52
|
@forward './typography/code/index';
|
|
53
|
+
@forward './typography/code-block/index';
|
|
44
54
|
@forward './typography/heading/index';
|
|
45
55
|
@forward './typography/kbd/index';
|
|
46
56
|
@forward './typography/link/index';
|
|
57
|
+
@forward './typography/list/index';
|
|
47
58
|
@forward './typography/mark/index';
|
|
Binary file
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "code-block",
|
|
3
|
+
"element": "pre",
|
|
4
|
+
"modifiers": {
|
|
5
|
+
"compact": {
|
|
6
|
+
"type": "boolean"
|
|
7
|
+
},
|
|
8
|
+
"line-numbers": {
|
|
9
|
+
"type": "boolean"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"subElements": ["code", "line", "line-number"],
|
|
13
|
+
"relatedComponents": ["code"],
|
|
14
|
+
"cssVars": [
|
|
15
|
+
{
|
|
16
|
+
"name": "--ui-code-block-bg",
|
|
17
|
+
"default": "var(--ui-color-bg-muted)"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "--ui-code-block-color",
|
|
21
|
+
"default": "var(--ui-color-text)"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "--ui-code-block-border-color",
|
|
25
|
+
"default": "var(--ui-color-border)"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "--ui-code-block-padding",
|
|
29
|
+
"default": "var(--ui-space-3)"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "--ui-code-block-font-size",
|
|
33
|
+
"default": "var(--ui-font-size-sm)"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "--ui-code-block-line-height",
|
|
37
|
+
"default": "var(--ui-leading-tight-sm)"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "--ui-code-block-radius",
|
|
41
|
+
"default": "var(--ui-radius-md)"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "--ui-code-block-padding-compact",
|
|
45
|
+
"default": "var(--ui-space-1)"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "--ui-code-block-line-number-color",
|
|
49
|
+
"default": "var(--ui-color-text-muted)"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "--ui-code-block-line-number-border-color",
|
|
53
|
+
"default": "var(--ui-color-border)"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "code-block",
|
|
3
|
+
"type": "component",
|
|
4
|
+
"title": "Code Block",
|
|
5
|
+
"description": "Multi-line code display with monospace font, horizontal scroll, and optional line numbers.",
|
|
6
|
+
"api": "./code-block.api.json",
|
|
7
|
+
"sections": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Default",
|
|
10
|
+
"examples": [
|
|
11
|
+
{
|
|
12
|
+
"items": [
|
|
13
|
+
{
|
|
14
|
+
"tag": "pre",
|
|
15
|
+
"class": "ui-code-block",
|
|
16
|
+
"children": [
|
|
17
|
+
{
|
|
18
|
+
"tag": "code",
|
|
19
|
+
"class": "ui-code-block__code",
|
|
20
|
+
"text": ".button {\n display: inline-flex;\n align-items: center;\n gap: var(--ui-space-1);\n}"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"title": "Horizontal overflow",
|
|
30
|
+
"examples": [
|
|
31
|
+
{
|
|
32
|
+
"items": [
|
|
33
|
+
{
|
|
34
|
+
"tag": "pre",
|
|
35
|
+
"class": "ui-code-block",
|
|
36
|
+
"children": [
|
|
37
|
+
{
|
|
38
|
+
"tag": "code",
|
|
39
|
+
"class": "ui-code-block__code",
|
|
40
|
+
"text": "export function calculateGridRhythm(element: HTMLElement, unit: number): { violations: string[]; totalHeight: number } {\n const computed = getComputedStyle(element);\n return { violations: [], totalHeight: parseFloat(computed.height) };\n}"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"title": "Compact",
|
|
50
|
+
"examples": [
|
|
51
|
+
{
|
|
52
|
+
"items": [
|
|
53
|
+
{
|
|
54
|
+
"tag": "pre",
|
|
55
|
+
"class": "ui-code-block ui-code-block--compact",
|
|
56
|
+
"children": [
|
|
57
|
+
{
|
|
58
|
+
"tag": "code",
|
|
59
|
+
"class": "ui-code-block__code",
|
|
60
|
+
"text": "npm install @teseor/css\nimport \"@teseor/css/dist/index.css\";"
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"title": "Line numbers",
|
|
70
|
+
"examples": [
|
|
71
|
+
{
|
|
72
|
+
"items": [
|
|
73
|
+
{
|
|
74
|
+
"tag": "pre",
|
|
75
|
+
"class": "ui-code-block ui-code-block--line-numbers",
|
|
76
|
+
"children": [
|
|
77
|
+
{
|
|
78
|
+
"tag": "code",
|
|
79
|
+
"class": "ui-code-block__code",
|
|
80
|
+
"children": [
|
|
81
|
+
{
|
|
82
|
+
"tag": "span",
|
|
83
|
+
"class": "ui-code-block__line",
|
|
84
|
+
"children": [
|
|
85
|
+
{
|
|
86
|
+
"tag": "span",
|
|
87
|
+
"class": "ui-code-block__line-number"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"tag": "span",
|
|
91
|
+
"text": "@layer components {"
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"tag": "span",
|
|
97
|
+
"class": "ui-code-block__line",
|
|
98
|
+
"children": [
|
|
99
|
+
{
|
|
100
|
+
"tag": "span",
|
|
101
|
+
"class": "ui-code-block__line-number"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"tag": "span",
|
|
105
|
+
"text": " .card {"
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"tag": "span",
|
|
111
|
+
"class": "ui-code-block__line",
|
|
112
|
+
"children": [
|
|
113
|
+
{
|
|
114
|
+
"tag": "span",
|
|
115
|
+
"class": "ui-code-block__line-number"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"tag": "span",
|
|
119
|
+
"text": " padding: var(--_padding);"
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"tag": "span",
|
|
125
|
+
"class": "ui-code-block__line",
|
|
126
|
+
"children": [
|
|
127
|
+
{
|
|
128
|
+
"tag": "span",
|
|
129
|
+
"class": "ui-code-block__line-number"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"tag": "span",
|
|
133
|
+
"text": " background: var(--_bg);"
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"tag": "span",
|
|
139
|
+
"class": "ui-code-block__line",
|
|
140
|
+
"children": [
|
|
141
|
+
{
|
|
142
|
+
"tag": "span",
|
|
143
|
+
"class": "ui-code-block__line-number"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"tag": "span",
|
|
147
|
+
"text": " border-radius: var(--_radius);"
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"tag": "span",
|
|
153
|
+
"class": "ui-code-block__line",
|
|
154
|
+
"children": [
|
|
155
|
+
{
|
|
156
|
+
"tag": "span",
|
|
157
|
+
"class": "ui-code-block__line-number"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"tag": "span",
|
|
161
|
+
"text": " }"
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"tag": "span",
|
|
167
|
+
"class": "ui-code-block__line",
|
|
168
|
+
"children": [
|
|
169
|
+
{
|
|
170
|
+
"tag": "span",
|
|
171
|
+
"class": "ui-code-block__line-number"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"tag": "span",
|
|
175
|
+
"text": "}"
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"title": "Compact with line numbers",
|
|
189
|
+
"examples": [
|
|
190
|
+
{
|
|
191
|
+
"items": [
|
|
192
|
+
{
|
|
193
|
+
"tag": "pre",
|
|
194
|
+
"class": "ui-code-block ui-code-block--compact ui-code-block--line-numbers",
|
|
195
|
+
"children": [
|
|
196
|
+
{
|
|
197
|
+
"tag": "code",
|
|
198
|
+
"class": "ui-code-block__code",
|
|
199
|
+
"children": [
|
|
200
|
+
{
|
|
201
|
+
"tag": "span",
|
|
202
|
+
"class": "ui-code-block__line",
|
|
203
|
+
"children": [
|
|
204
|
+
{
|
|
205
|
+
"tag": "span",
|
|
206
|
+
"class": "ui-code-block__line-number"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"tag": "span",
|
|
210
|
+
"text": "const name = \"world\";"
|
|
211
|
+
}
|
|
212
|
+
]
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"tag": "span",
|
|
216
|
+
"class": "ui-code-block__line",
|
|
217
|
+
"children": [
|
|
218
|
+
{
|
|
219
|
+
"tag": "span",
|
|
220
|
+
"class": "ui-code-block__line-number"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"tag": "span",
|
|
224
|
+
"text": "console.log(`Hello, ${name}`);"
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
}
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
]
|
|
233
|
+
}
|
|
234
|
+
]
|
|
235
|
+
}
|
|
236
|
+
],
|
|
237
|
+
"customization": [
|
|
238
|
+
{
|
|
239
|
+
"token": "--ui-code-block-bg",
|
|
240
|
+
"default": "var(--ui-color-bg-muted)",
|
|
241
|
+
"description": "Background color"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"token": "--ui-code-block-color",
|
|
245
|
+
"default": "var(--ui-color-text)",
|
|
246
|
+
"description": "Text color"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"token": "--ui-code-block-border-color",
|
|
250
|
+
"default": "var(--ui-color-border)",
|
|
251
|
+
"description": "Border color"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"token": "--ui-code-block-padding",
|
|
255
|
+
"default": "var(--ui-space-3)",
|
|
256
|
+
"description": "Content padding"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"token": "--ui-code-block-font-size",
|
|
260
|
+
"default": "var(--ui-font-size-sm)",
|
|
261
|
+
"description": "Font size"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"token": "--ui-code-block-line-height",
|
|
265
|
+
"default": "var(--ui-leading-tight-sm)",
|
|
266
|
+
"description": "Line height"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"token": "--ui-code-block-radius",
|
|
270
|
+
"default": "var(--ui-radius-md)",
|
|
271
|
+
"description": "Border radius"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"token": "--ui-code-block-padding-compact",
|
|
275
|
+
"default": "var(--ui-space-1)",
|
|
276
|
+
"description": "Padding for compact variant"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"token": "--ui-code-block-line-number-color",
|
|
280
|
+
"default": "var(--ui-color-text-muted)",
|
|
281
|
+
"description": "Line number text color"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"token": "--ui-code-block-line-number-border-color",
|
|
285
|
+
"default": "var(--ui-color-border)",
|
|
286
|
+
"description": "Line number separator color"
|
|
287
|
+
}
|
|
288
|
+
]
|
|
289
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import { expect, test } from '@playwright/test';
|
|
3
|
+
import { saveForLostPixel, setupVisualTestFromDocs, validateGridRhythm } from '../../../testing';
|
|
4
|
+
|
|
5
|
+
const DOCS_PATH = resolve(__dirname, 'code-block.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('code-block visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'code-block');
|
|
11
|
+
await saveForLostPixel(page, 'code-block');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('code-block.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
@use '../../../00-config/tokens/variables' as t;
|
|
2
|
+
|
|
3
|
+
// Token definitions
|
|
4
|
+
@layer components.tokens {
|
|
5
|
+
.code-block {
|
|
6
|
+
--_bg: var(--ui-code-block-bg, var(--ui-color-bg-muted, #{t.$color-bg-muted}));
|
|
7
|
+
--_color: var(--ui-code-block-color, var(--ui-color-text, #{t.$color-text}));
|
|
8
|
+
--_border-color: var(--ui-code-block-border-color, var(--ui-color-border, #{t.$color-border}));
|
|
9
|
+
--_padding: var(--ui-code-block-padding, var(--ui-space-3, #{t.$space-3}));
|
|
10
|
+
--_font-size: var(--ui-code-block-font-size, var(--ui-font-size-sm, #{t.$font-size-sm}));
|
|
11
|
+
--_line-height: var(--ui-code-block-line-height, var(--ui-leading-tight-sm, #{t.$leading-tight-sm}));
|
|
12
|
+
--_radius: var(--ui-code-block-radius, var(--ui-radius-md, #{t.$radius-md}));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.code-block--compact {
|
|
16
|
+
--_padding: var(--ui-code-block-padding-compact, var(--ui-space-1, #{t.$space-1}));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.code-block--line-numbers {
|
|
20
|
+
--_line-number-color: var(--ui-code-block-line-number-color, var(--ui-color-text-muted, #{t.$color-text-muted}));
|
|
21
|
+
--_line-number-border-color: var(--ui-code-block-line-number-border-color, var(--ui-color-border, #{t.$color-border}));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Implementation
|
|
26
|
+
@layer components.styles {
|
|
27
|
+
.code-block {
|
|
28
|
+
display: block;
|
|
29
|
+
// Subtract border from padding to keep total on grid
|
|
30
|
+
padding: calc(var(--_padding) - var(--ui-border-width-sm, #{t.$border-width-sm}));
|
|
31
|
+
overflow-x: auto;
|
|
32
|
+
|
|
33
|
+
font-family: var(--ui-font-mono, #{t.$font-mono});
|
|
34
|
+
font-size: var(--_font-size);
|
|
35
|
+
line-height: var(--_line-height);
|
|
36
|
+
white-space: pre;
|
|
37
|
+
color: var(--_color);
|
|
38
|
+
|
|
39
|
+
background: var(--_bg);
|
|
40
|
+
border: var(--ui-border-width-sm, #{t.$border-width-sm}) solid var(--_border-color);
|
|
41
|
+
border-radius: var(--_radius);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Reset nested code element
|
|
45
|
+
.code-block__code {
|
|
46
|
+
padding: 0;
|
|
47
|
+
|
|
48
|
+
font: inherit;
|
|
49
|
+
color: inherit;
|
|
50
|
+
|
|
51
|
+
background: none;
|
|
52
|
+
border: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Line numbers via CSS counters
|
|
56
|
+
.code-block--line-numbers {
|
|
57
|
+
counter-reset: line-number;
|
|
58
|
+
|
|
59
|
+
padding-inline-start: 0;
|
|
60
|
+
|
|
61
|
+
.code-block__line {
|
|
62
|
+
display: block;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.code-block__line-number {
|
|
66
|
+
display: inline-block;
|
|
67
|
+
counter-increment: line-number;
|
|
68
|
+
|
|
69
|
+
box-sizing: border-box;
|
|
70
|
+
min-inline-size: var(--ui-space-4, #{t.$space-4});
|
|
71
|
+
padding-inline-end: var(--ui-space-2, #{t.$space-2});
|
|
72
|
+
margin-inline-end: var(--ui-space-2, #{t.$space-2});
|
|
73
|
+
|
|
74
|
+
font-variant-numeric: tabular-nums;
|
|
75
|
+
|
|
76
|
+
text-align: end;
|
|
77
|
+
color: var(--_line-number-color);
|
|
78
|
+
|
|
79
|
+
border-inline-end: var(--ui-border-width-sm, #{t.$border-width-sm}) solid var(--_line-number-border-color);
|
|
80
|
+
user-select: none;
|
|
81
|
+
|
|
82
|
+
&::before {
|
|
83
|
+
content: counter(line-number);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
@use '../../../00-config/tokens/variables' as t;
|
|
2
|
+
|
|
3
|
+
// Ordered and unordered lists with spacing and layout variants
|
|
4
|
+
|
|
5
|
+
@layer components.tokens {
|
|
6
|
+
.list {
|
|
7
|
+
--_spacing: var(--ui-list-spacing, #{t.$unit});
|
|
8
|
+
--_marker-color: var(--ui-list-marker-color, var(--ui-color-text-muted, #{t.$color-text-muted}));
|
|
9
|
+
--_indent: var(--ui-list-indent, var(--ui-space-3, #{t.$space-3}));
|
|
10
|
+
--_line-height: var(--ui-list-line-height, var(--ui-leading-md, #{t.$leading-md}));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// @modifier spacing
|
|
14
|
+
.list--compact {
|
|
15
|
+
--_spacing: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.list--loose {
|
|
19
|
+
--_spacing: calc(#{t.$unit} * 2);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@layer components.styles {
|
|
24
|
+
.list {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
gap: var(--_spacing);
|
|
28
|
+
|
|
29
|
+
padding-inline-start: var(--_indent);
|
|
30
|
+
margin: 0;
|
|
31
|
+
|
|
32
|
+
line-height: var(--_line-height);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.list::marker,
|
|
36
|
+
.list li::marker {
|
|
37
|
+
color: var(--_marker-color);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Removes markers and indent
|
|
41
|
+
.list--unstyled {
|
|
42
|
+
padding-inline-start: 0;
|
|
43
|
+
|
|
44
|
+
list-style: none;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Horizontal flow with wrapping
|
|
48
|
+
.list--inline {
|
|
49
|
+
flex-direction: row;
|
|
50
|
+
flex-wrap: wrap;
|
|
51
|
+
|
|
52
|
+
padding-inline-start: 0;
|
|
53
|
+
|
|
54
|
+
list-style: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Nested lists inherit spacing
|
|
58
|
+
.list .list {
|
|
59
|
+
margin-block-start: var(--_spacing);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.list__item {
|
|
63
|
+
line-height: var(--_line-height);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "list",
|
|
3
|
+
"element": "ul",
|
|
4
|
+
"modifiers": {
|
|
5
|
+
"style": {
|
|
6
|
+
"values": ["unstyled", "inline"]
|
|
7
|
+
},
|
|
8
|
+
"spacing": {
|
|
9
|
+
"values": ["compact", "loose"]
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"elements": {
|
|
13
|
+
"item": {}
|
|
14
|
+
},
|
|
15
|
+
"cssVars": [
|
|
16
|
+
{
|
|
17
|
+
"name": "--ui-list-spacing",
|
|
18
|
+
"default": "var(--unit)"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "--ui-list-marker-color",
|
|
22
|
+
"default": "var(--ui-color-text-muted)"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "--ui-list-indent",
|
|
26
|
+
"default": "var(--ui-space-3)"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "--ui-list-line-height",
|
|
30
|
+
"default": "var(--ui-leading-md)"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|