@adamarant/designsystem 0.11.2
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/README.md +101 -0
- package/dist/designsystem.css +13494 -0
- package/dist/designsystem.js +67 -0
- package/dist/designsystem.min.css +2 -0
- package/package.json +111 -0
- package/src/base/index.css +2 -0
- package/src/base/reset.css +119 -0
- package/src/base/typography.css +172 -0
- package/src/components/accordion.css +166 -0
- package/src/components/admin-layout.css +371 -0
- package/src/components/alert.css +159 -0
- package/src/components/avatar.css +109 -0
- package/src/components/badge.css +80 -0
- package/src/components/bottom-nav.css +125 -0
- package/src/components/bottom-sheet.css +146 -0
- package/src/components/breadcrumb.css +102 -0
- package/src/components/button.css +250 -0
- package/src/components/card.css +117 -0
- package/src/components/chip.css +79 -0
- package/src/components/collapsible.css +112 -0
- package/src/components/color-picker.css +82 -0
- package/src/components/combobox.css +420 -0
- package/src/components/command.css +210 -0
- package/src/components/context-menu.css +162 -0
- package/src/components/copy-button.css +106 -0
- package/src/components/custom-select.css +446 -0
- package/src/components/datepicker.css +301 -0
- package/src/components/description-list.css +100 -0
- package/src/components/divider.css +66 -0
- package/src/components/drawer.css +234 -0
- package/src/components/drop-zone.css +166 -0
- package/src/components/dropdown.css +169 -0
- package/src/components/empty-state.css +75 -0
- package/src/components/field.css +112 -0
- package/src/components/gallery.css +257 -0
- package/src/components/hero.css +111 -0
- package/src/components/icon-btn.css +103 -0
- package/src/components/index.css +74 -0
- package/src/components/input.css +311 -0
- package/src/components/kbd.css +54 -0
- package/src/components/media-library.css +230 -0
- package/src/components/modal.css +136 -0
- package/src/components/nav.css +198 -0
- package/src/components/number-input.css +163 -0
- package/src/components/pagination.css +175 -0
- package/src/components/pin-input.css +136 -0
- package/src/components/popover.css +111 -0
- package/src/components/progress.css +217 -0
- package/src/components/prose.css +337 -0
- package/src/components/result.css +80 -0
- package/src/components/scroll-area.css +73 -0
- package/src/components/search.css +311 -0
- package/src/components/segmented-control.css +94 -0
- package/src/components/skeleton.css +100 -0
- package/src/components/slider.css +133 -0
- package/src/components/sortable.css +70 -0
- package/src/components/spinner.css +60 -0
- package/src/components/star-rating.css +121 -0
- package/src/components/stat-card.css +44 -0
- package/src/components/table.css +359 -0
- package/src/components/tabs.css +215 -0
- package/src/components/tag.css +188 -0
- package/src/components/timeline.css +130 -0
- package/src/components/toast.css +90 -0
- package/src/components/toggle.css +173 -0
- package/src/components/toolbar.css +206 -0
- package/src/components/tooltip.css +167 -0
- package/src/components/truncated-text.css +75 -0
- package/src/index.css +21 -0
- package/src/js/theme.js +67 -0
- package/src/tokens/colors.css +256 -0
- package/src/tokens/index.css +11 -0
- package/src/tokens/shadows.css +55 -0
- package/src/tokens/spacing.css +82 -0
- package/src/tokens/tokens.json +413 -0
- package/src/tokens/typography.css +90 -0
- package/src/utilities/a11y.css +102 -0
- package/src/utilities/index.css +7 -0
- package/src/utilities/interactive.css +121 -0
- package/src/utilities/layout.css +273 -0
- package/src/utilities/sizing.css +85 -0
- package/src/utilities/spacing.css +204 -0
- package/src/utilities/states.css +182 -0
- package/src/utilities/text.css +381 -0
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Component: Prose Block
|
|
3
|
+
Full markdown-rendered content styling. Use for CMS output, blog posts,
|
|
4
|
+
documentation, or any container with user-generated rich text.
|
|
5
|
+
|
|
6
|
+
Note: The lighter `.ds-prose` in base/typography.css handles simple
|
|
7
|
+
inline rich text (p + p spacing, links, lists). This component is for
|
|
8
|
+
comprehensive markdown rendering with headings, code blocks, blockquotes,
|
|
9
|
+
images, and horizontal rules.
|
|
10
|
+
|
|
11
|
+
Usage:
|
|
12
|
+
<div class="ds-prose-block">
|
|
13
|
+
<h2>Title</h2>
|
|
14
|
+
<p>Paragraph with <a href="#">link</a> and <code>code</code>.</p>
|
|
15
|
+
<pre><code>code block</code></pre>
|
|
16
|
+
<blockquote>Quote</blockquote>
|
|
17
|
+
</div>
|
|
18
|
+
========================================================================== */
|
|
19
|
+
|
|
20
|
+
.ds-prose-block {
|
|
21
|
+
line-height: var(--ds-leading-relaxed);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ds-prose-block :is(h1, h2, h3, h4, h5, h6) {
|
|
25
|
+
font-family: var(--ds-font-display);
|
|
26
|
+
font-weight: var(--ds-font-display-weight);
|
|
27
|
+
letter-spacing: var(--ds-tracking-tight);
|
|
28
|
+
color: var(--ds-color-text);
|
|
29
|
+
margin-block-start: 1.5em;
|
|
30
|
+
margin-block-end: 0.5em;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.ds-prose-block :is(h1, h2, h3, h4, h5, h6):first-child {
|
|
34
|
+
margin-block-start: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.ds-prose-block p {
|
|
38
|
+
color: var(--ds-color-text-secondary);
|
|
39
|
+
margin-block-end: 1em;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ds-prose-block p:last-child {
|
|
43
|
+
margin-block-end: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ds-prose-block a {
|
|
47
|
+
color: var(--ds-color-interactive);
|
|
48
|
+
text-decoration: none;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ds-prose-block a:hover {
|
|
52
|
+
text-decoration: underline;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.ds-prose-block strong {
|
|
56
|
+
color: var(--ds-color-text);
|
|
57
|
+
font-weight: var(--ds-weight-semibold);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ds-prose-block code {
|
|
61
|
+
font-family: var(--ds-font-mono);
|
|
62
|
+
font-size: var(--ds-text-sm);
|
|
63
|
+
background-color: var(--ds-color-surface-muted);
|
|
64
|
+
padding: 0.125em 0.375em;
|
|
65
|
+
border-radius: var(--ds-radius-sm);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.ds-prose-block pre {
|
|
69
|
+
background-color: var(--ds-color-surface-muted);
|
|
70
|
+
padding: var(--ds-space-4);
|
|
71
|
+
border-radius: var(--ds-radius-lg);
|
|
72
|
+
overflow-x: auto;
|
|
73
|
+
margin-block-end: 1em;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.ds-prose-block pre code {
|
|
77
|
+
background: none;
|
|
78
|
+
padding: 0;
|
|
79
|
+
border-radius: 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ds-prose-block ul,
|
|
83
|
+
.ds-prose-block ol {
|
|
84
|
+
padding-inline-start: 1.5em;
|
|
85
|
+
margin-block-end: 1em;
|
|
86
|
+
color: var(--ds-color-text-secondary);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.ds-prose-block li {
|
|
90
|
+
margin-block-end: 0.25em;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.ds-prose-block ul {
|
|
94
|
+
list-style-type: disc;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.ds-prose-block ol {
|
|
98
|
+
list-style-type: decimal;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.ds-prose-block blockquote {
|
|
102
|
+
border-inline-start: 3px solid var(--ds-color-border);
|
|
103
|
+
padding-inline-start: var(--ds-space-4);
|
|
104
|
+
color: var(--ds-color-text-secondary);
|
|
105
|
+
font-style: italic;
|
|
106
|
+
margin-block-end: 1em;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.ds-prose-block hr {
|
|
110
|
+
border: none;
|
|
111
|
+
border-block-start: 1px solid var(--ds-color-border);
|
|
112
|
+
margin-block: var(--ds-space-6);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.ds-prose-block img {
|
|
116
|
+
max-width: 100%;
|
|
117
|
+
border-radius: var(--ds-radius-lg);
|
|
118
|
+
margin-block-end: 1em;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.ds-prose-block table {
|
|
122
|
+
width: 100%;
|
|
123
|
+
border-collapse: collapse;
|
|
124
|
+
margin-block-end: 1em;
|
|
125
|
+
font-size: var(--ds-text-sm);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.ds-prose-block :is(th, td) {
|
|
129
|
+
padding: var(--ds-space-3);
|
|
130
|
+
text-align: start;
|
|
131
|
+
vertical-align: top;
|
|
132
|
+
border-block-end: 1px solid var(--ds-color-border);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.ds-prose-block th {
|
|
136
|
+
color: var(--ds-color-text);
|
|
137
|
+
font-weight: var(--ds-weight-semibold);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.ds-prose-block td {
|
|
141
|
+
color: var(--ds-color-text-secondary);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* ==========================================================================
|
|
145
|
+
Editorial long-form typography (promoted from esys blog — 12 Apr 2026)
|
|
146
|
+
|
|
147
|
+
Three classes that together make an article page look like a magazine
|
|
148
|
+
instead of a dashboard. They fill the gap between .ds-hero-title (too
|
|
149
|
+
big for articles) and .ds-prose-block (whose h2 is 4xl — too heavy for
|
|
150
|
+
reading rhythm).
|
|
151
|
+
|
|
152
|
+
Usage:
|
|
153
|
+
<h1 class="ds-editorial-title">The title of the article</h1>
|
|
154
|
+
<p class="ds-editorial-lede">The lead paragraph, larger than body.</p>
|
|
155
|
+
<div class="ds-editorial-body">
|
|
156
|
+
<h2>Section</h2>
|
|
157
|
+
<p>Body text at 17px, line-height loose, with proper h2/h3 scale.</p>
|
|
158
|
+
</div>
|
|
159
|
+
|
|
160
|
+
Designed for: blog posts, long-form articles, editorial landing, magazine
|
|
161
|
+
layouts. NOT for admin UI, dashboards, or functional copy — use
|
|
162
|
+
.ds-heading-ui / .ds-section-title / .ds-prose-block for those.
|
|
163
|
+
========================================================================== */
|
|
164
|
+
|
|
165
|
+
.ds-editorial-title {
|
|
166
|
+
font-family: var(--ds-font-display);
|
|
167
|
+
font-size: var(--ds-text-editorial-title);
|
|
168
|
+
font-weight: var(--ds-font-display-weight);
|
|
169
|
+
line-height: var(--ds-leading-tight);
|
|
170
|
+
letter-spacing: var(--ds-tracking-tight);
|
|
171
|
+
color: var(--ds-color-text);
|
|
172
|
+
margin: 0;
|
|
173
|
+
text-wrap: balance;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.ds-editorial-lede {
|
|
177
|
+
font-family: var(--ds-font-sans);
|
|
178
|
+
font-size: var(--ds-text-editorial-lede);
|
|
179
|
+
line-height: var(--ds-leading-normal);
|
|
180
|
+
color: var(--ds-color-text-secondary);
|
|
181
|
+
margin: 0;
|
|
182
|
+
max-width: 600px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* Editorial header rhythm — when overline / title / lede appear in sequence,
|
|
186
|
+
apply natural top margins so a consumer does not need to hand-space them.
|
|
187
|
+
Promoted from esys + studio consumer rules (v0.10.2). */
|
|
188
|
+
.ds-overline + .ds-editorial-title {
|
|
189
|
+
margin-block-start: var(--ds-space-3);
|
|
190
|
+
}
|
|
191
|
+
.ds-editorial-title + .ds-editorial-lede {
|
|
192
|
+
margin-block-start: var(--ds-space-4);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.ds-editorial-body {
|
|
196
|
+
color: var(--ds-color-text-secondary);
|
|
197
|
+
font-size: var(--ds-text-editorial-body);
|
|
198
|
+
line-height: var(--ds-leading-relaxed);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/* Paragraphs inherit from the wrapper (previously forced to primary in v0.10.1).
|
|
202
|
+
Editorial long-form uses secondary for calmer reading colour (v0.10.2). */
|
|
203
|
+
.ds-editorial-body p {
|
|
204
|
+
color: inherit;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.ds-editorial-body > * + * {
|
|
208
|
+
margin-block-start: var(--ds-space-5);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.ds-editorial-body h2 {
|
|
212
|
+
font-family: var(--ds-font-display);
|
|
213
|
+
font-size: var(--ds-text-4xl);
|
|
214
|
+
font-weight: var(--ds-weight-medium);
|
|
215
|
+
line-height: var(--ds-leading-tight);
|
|
216
|
+
letter-spacing: var(--ds-tracking-tight);
|
|
217
|
+
color: var(--ds-color-text);
|
|
218
|
+
margin-block-start: var(--ds-space-12);
|
|
219
|
+
margin-block-end: 0;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.ds-editorial-body h3 {
|
|
223
|
+
font-family: var(--ds-font-display);
|
|
224
|
+
font-size: var(--ds-text-2xl);
|
|
225
|
+
font-weight: var(--ds-weight-medium);
|
|
226
|
+
line-height: var(--ds-leading-snug);
|
|
227
|
+
letter-spacing: var(--ds-tracking-tight);
|
|
228
|
+
color: var(--ds-color-text);
|
|
229
|
+
margin-block-start: var(--ds-space-8);
|
|
230
|
+
margin-block-end: 0;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.ds-editorial-body h4 {
|
|
234
|
+
font-family: var(--ds-font-display);
|
|
235
|
+
font-size: var(--ds-text-lg);
|
|
236
|
+
font-weight: var(--ds-font-display-weight);
|
|
237
|
+
color: var(--ds-color-text);
|
|
238
|
+
margin-block-start: var(--ds-space-6);
|
|
239
|
+
margin-block-end: 0;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.ds-editorial-body a {
|
|
243
|
+
color: var(--ds-color-interactive);
|
|
244
|
+
text-decoration: underline;
|
|
245
|
+
text-underline-offset: 2px;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.ds-editorial-body a:hover {
|
|
249
|
+
text-decoration: none;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.ds-editorial-body strong {
|
|
253
|
+
color: var(--ds-color-text);
|
|
254
|
+
font-weight: var(--ds-weight-semibold);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.ds-editorial-body ul,
|
|
258
|
+
.ds-editorial-body ol {
|
|
259
|
+
padding-inline-start: var(--ds-space-6);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.ds-editorial-body ul { list-style-type: disc; }
|
|
263
|
+
.ds-editorial-body ol { list-style-type: decimal; }
|
|
264
|
+
|
|
265
|
+
.ds-editorial-body li + li {
|
|
266
|
+
margin-block-start: var(--ds-space-2);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.ds-editorial-body blockquote {
|
|
270
|
+
border-inline-start: 3px solid var(--ds-color-border-hover);
|
|
271
|
+
padding-inline-start: var(--ds-space-4);
|
|
272
|
+
color: var(--ds-color-text-secondary);
|
|
273
|
+
font-style: italic;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.ds-editorial-body img {
|
|
277
|
+
max-width: 100%;
|
|
278
|
+
height: auto;
|
|
279
|
+
border-radius: var(--ds-radius-md);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.ds-editorial-body hr {
|
|
283
|
+
border: none;
|
|
284
|
+
border-block-start: 1px solid var(--ds-color-border);
|
|
285
|
+
margin-block: var(--ds-space-6);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.ds-editorial-body pre {
|
|
289
|
+
background: var(--ds-color-surface-muted);
|
|
290
|
+
padding: var(--ds-space-4);
|
|
291
|
+
border-radius: var(--ds-radius-md);
|
|
292
|
+
overflow-x: auto;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.ds-editorial-body code {
|
|
296
|
+
background: var(--ds-color-surface-muted);
|
|
297
|
+
padding: 0.125em 0.375em;
|
|
298
|
+
border-radius: var(--ds-radius-sm);
|
|
299
|
+
font-family: var(--ds-font-mono);
|
|
300
|
+
font-size: 0.9em;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.ds-editorial-body pre code {
|
|
304
|
+
background: transparent;
|
|
305
|
+
padding: 0;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.ds-editorial-body table {
|
|
309
|
+
width: 100%;
|
|
310
|
+
border-collapse: collapse;
|
|
311
|
+
font-size: var(--ds-text-sm);
|
|
312
|
+
line-height: var(--ds-leading-normal);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.ds-editorial-body :is(th, td) {
|
|
316
|
+
padding: var(--ds-space-3);
|
|
317
|
+
text-align: start;
|
|
318
|
+
vertical-align: top;
|
|
319
|
+
border-block-end: 1px solid var(--ds-color-border);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.ds-editorial-body th {
|
|
323
|
+
color: var(--ds-color-text);
|
|
324
|
+
font-weight: var(--ds-weight-semibold);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.ds-editorial-body thead th {
|
|
328
|
+
border-block-end-color: var(--ds-color-border-hover);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.ds-editorial-body td {
|
|
332
|
+
color: var(--ds-color-text-secondary);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.ds-editorial-body tbody tr:last-child :is(th, td) {
|
|
336
|
+
border-block-end: none;
|
|
337
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Component: Result
|
|
3
|
+
Feedback page for success, error, 404, empty, etc.
|
|
4
|
+
========================================================================== */
|
|
5
|
+
|
|
6
|
+
.ds-result {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
align-items: center;
|
|
10
|
+
text-align: center;
|
|
11
|
+
padding: var(--ds-space-12) var(--ds-space-6);
|
|
12
|
+
max-width: 28rem;
|
|
13
|
+
margin-inline: auto;
|
|
14
|
+
|
|
15
|
+
/* ---------------------------------------------------------------------------
|
|
16
|
+
Icon
|
|
17
|
+
--------------------------------------------------------------------------- */
|
|
18
|
+
|
|
19
|
+
&__icon {
|
|
20
|
+
width: 3rem;
|
|
21
|
+
height: 3rem;
|
|
22
|
+
margin-block-end: var(--ds-space-4);
|
|
23
|
+
color: var(--ds-color-text-secondary);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* ---------------------------------------------------------------------------
|
|
27
|
+
Title
|
|
28
|
+
--------------------------------------------------------------------------- */
|
|
29
|
+
|
|
30
|
+
&__title {
|
|
31
|
+
font-family: var(--ds-font-display);
|
|
32
|
+
font-weight: var(--ds-weight-semibold);
|
|
33
|
+
font-size: var(--ds-text-xl);
|
|
34
|
+
color: var(--ds-color-text);
|
|
35
|
+
line-height: var(--ds-leading-tight);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* ---------------------------------------------------------------------------
|
|
39
|
+
Description
|
|
40
|
+
--------------------------------------------------------------------------- */
|
|
41
|
+
|
|
42
|
+
&__description {
|
|
43
|
+
font-size: var(--ds-text-sm);
|
|
44
|
+
color: var(--ds-color-text-secondary);
|
|
45
|
+
line-height: var(--ds-leading-relaxed);
|
|
46
|
+
margin-block-start: var(--ds-space-2);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* ---------------------------------------------------------------------------
|
|
50
|
+
Actions
|
|
51
|
+
--------------------------------------------------------------------------- */
|
|
52
|
+
|
|
53
|
+
&__actions {
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
gap: var(--ds-space-3);
|
|
58
|
+
margin-block-start: var(--ds-space-6);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* ---------------------------------------------------------------------------
|
|
62
|
+
Semantic variants — icon color
|
|
63
|
+
--------------------------------------------------------------------------- */
|
|
64
|
+
|
|
65
|
+
&--success &__icon {
|
|
66
|
+
color: var(--ds-color-success);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&--warning &__icon {
|
|
70
|
+
color: var(--ds-color-warning);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&--error &__icon {
|
|
74
|
+
color: var(--ds-color-error);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&--info &__icon {
|
|
78
|
+
color: var(--ds-color-info);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Component: Scroll Area
|
|
3
|
+
Custom-styled scrollbar for overflow containers. Cross-browser.
|
|
4
|
+
|
|
5
|
+
Usage:
|
|
6
|
+
<div class="ds-scroll-area" style="max-height: 20rem;">
|
|
7
|
+
...long content...
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
Modifiers:
|
|
11
|
+
.ds-scroll-area--horizontal — Horizontal scroll
|
|
12
|
+
.ds-scroll-area--both — Both directions
|
|
13
|
+
.ds-scroll-area--thin — Thinner scrollbar
|
|
14
|
+
========================================================================== */
|
|
15
|
+
|
|
16
|
+
.ds-scroll-area {
|
|
17
|
+
overflow-y: auto;
|
|
18
|
+
overscroll-behavior: contain;
|
|
19
|
+
|
|
20
|
+
/* Firefox */
|
|
21
|
+
scrollbar-width: thin;
|
|
22
|
+
scrollbar-color: var(--ds-scrollbar-thumb) transparent;
|
|
23
|
+
|
|
24
|
+
/* WebKit (Chrome, Safari, Edge) */
|
|
25
|
+
&::-webkit-scrollbar {
|
|
26
|
+
width: 8px;
|
|
27
|
+
height: 8px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&::-webkit-scrollbar-track {
|
|
31
|
+
background: transparent;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&::-webkit-scrollbar-thumb {
|
|
35
|
+
background-color: var(--ds-scrollbar-thumb);
|
|
36
|
+
border-radius: var(--ds-radius-full);
|
|
37
|
+
border: 2px solid transparent;
|
|
38
|
+
background-clip: padding-box;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
42
|
+
background-color: var(--ds-scrollbar-thumb-hover);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&::-webkit-scrollbar-corner {
|
|
46
|
+
background: transparent;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* --- Horizontal --- */
|
|
50
|
+
&--horizontal {
|
|
51
|
+
overflow-y: hidden;
|
|
52
|
+
overflow-x: auto;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* --- Both directions --- */
|
|
56
|
+
&--both {
|
|
57
|
+
overflow: auto;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* --- Thin variant --- */
|
|
61
|
+
&--thin {
|
|
62
|
+
scrollbar-width: thin;
|
|
63
|
+
|
|
64
|
+
&::-webkit-scrollbar {
|
|
65
|
+
width: 4px;
|
|
66
|
+
height: 4px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&::-webkit-scrollbar-thumb {
|
|
70
|
+
border: 1px solid transparent;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|