@dereekb/dbx-web 13.16.0 → 13.18.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/_index.scss +4 -1
- package/eslint/package.json +4 -4
- package/fesm2022/dereekb-dbx-web-mapbox.mjs +2 -2
- package/fesm2022/dereekb-dbx-web-mapbox.mjs.map +1 -1
- package/fesm2022/dereekb-dbx-web-style-demo.mjs +1698 -0
- package/fesm2022/dereekb-dbx-web-style-demo.mjs.map +1 -0
- package/fesm2022/dereekb-dbx-web-table.mjs +1 -1
- package/fesm2022/dereekb-dbx-web-table.mjs.map +1 -1
- package/fesm2022/dereekb-dbx-web.mjs +460 -333
- package/fesm2022/dereekb-dbx-web.mjs.map +1 -1
- package/lib/button/_button.scss +74 -98
- package/lib/extension/pdf/_pdf.scss +5 -5
- package/lib/extension/table/_table.scss +2 -2
- package/lib/interaction/detach/_detach.scss +22 -2
- package/lib/interaction/dialog/_dialog.scss +4 -8
- package/lib/interaction/popup/_popup.scss +1 -2
- package/lib/interaction/prompt/_prompt.scss +7 -2
- package/lib/layout/avatar/_avatar.scss +8 -0
- package/lib/layout/bar/_bar.scss +41 -2
- package/lib/layout/card/_card.scss +191 -3
- package/lib/layout/column/_column.scss +3 -3
- package/lib/layout/content/_content.scss +24 -9
- package/lib/layout/list/_list.scss +87 -10
- package/lib/layout/section/_section.scss +7 -8
- package/lib/layout/style/_style.scss +44 -9
- package/lib/layout/text/_text.scss +73 -29
- package/lib/loading/_loading.scss +9 -2
- package/lib/router/layout/navbar/_navbar.scss +14 -0
- package/lib/router/layout/sidenav/_sidenav.scss +2 -2
- package/lib/style/_core.scss +4 -0
- package/lib/style/_corners.scss +79 -0
- package/lib/style/_root-variables.scss +17 -0
- package/lib/style/_shapes.scss +56 -0
- package/lib/style/_style-demo.scss +183 -0
- package/lib/style/_variables.scss +8 -1
- package/package.json +11 -7
- package/style-demo/README.md +12 -0
- package/types/dereekb-dbx-web-style-demo.d.ts +883 -0
- package/types/dereekb-dbx-web.d.ts +170 -79
- package/lib/style/_m2-visual-compat.scss +0 -120
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
@use '../../style/theming';
|
|
2
|
+
@use '../style/style';
|
|
2
3
|
|
|
3
4
|
// MARK: Variables
|
|
4
|
-
$icon-spacing:
|
|
5
|
-
$chip-spacing:
|
|
5
|
+
$icon-spacing: var(--dbx-padding-2);
|
|
6
|
+
$chip-spacing: var(--dbx-padding-1);
|
|
6
7
|
$hint-opacity: 0.8;
|
|
7
8
|
$faint-opacity: 0.54;
|
|
8
9
|
$note-opacity: 0.7;
|
|
9
10
|
$mat-hint-opacity: 0.54; // Opacity to mirror mat-hint
|
|
10
|
-
$dbx-label-padded-padding:
|
|
11
|
-
$dbx-detail-block-bottom-padding:
|
|
11
|
+
$dbx-label-padded-padding: var(--dbx-padding-2);
|
|
12
|
+
$dbx-detail-block-bottom-padding: var(--dbx-padding-3);
|
|
12
13
|
$dbx-detail-block-content-offset: 30px;
|
|
13
14
|
$click-to-copy-icon-size: 18px;
|
|
14
15
|
$dbx-detail-block-big-header-icon-size: 18px;
|
|
@@ -92,7 +93,7 @@ $dbx-step-block-badge-font-weight: 600;
|
|
|
92
93
|
align-items: center;
|
|
93
94
|
|
|
94
95
|
.mat-icon {
|
|
95
|
-
padding-right:
|
|
96
|
+
padding-right: var(--dbx-padding-2);
|
|
96
97
|
flex-shrink: 0; // do not allow shrinking
|
|
97
98
|
}
|
|
98
99
|
|
|
@@ -104,7 +105,7 @@ $dbx-step-block-badge-font-weight: 600;
|
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
.dbx-detail-block-header-no-icon {
|
|
107
|
-
padding-left: $dbx-detail-block-content-offset;
|
|
108
|
+
padding-left: var(--dbx-detail-block-content-offset, #{$dbx-detail-block-content-offset});
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
.dbx-detail-line {
|
|
@@ -113,7 +114,7 @@ $dbx-step-block-badge-font-weight: 600;
|
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
.dbx-detail-block-header-label {
|
|
116
|
-
padding-right:
|
|
117
|
+
padding-right: var(--dbx-padding-1);
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
.dbx-detail-block-header.dbx-detail-block-header-align {
|
|
@@ -132,7 +133,7 @@ $dbx-step-block-badge-font-weight: 600;
|
|
|
132
133
|
display: block;
|
|
133
134
|
|
|
134
135
|
.dbx-detail-block-header {
|
|
135
|
-
padding-bottom:
|
|
136
|
+
padding-bottom: var(--dbx-padding-1);
|
|
136
137
|
|
|
137
138
|
.dbx-detail-block-header-label {
|
|
138
139
|
font-weight: 400;
|
|
@@ -142,7 +143,7 @@ $dbx-step-block-badge-font-weight: 600;
|
|
|
142
143
|
.dbx-detail-block-content {
|
|
143
144
|
opacity: 0.8;
|
|
144
145
|
font-size: 0.9em;
|
|
145
|
-
padding-left: $dbx-detail-block-content-offset;
|
|
146
|
+
padding-left: var(--dbx-detail-block-content-offset, #{$dbx-detail-block-content-offset});
|
|
146
147
|
}
|
|
147
148
|
|
|
148
149
|
padding-bottom: $dbx-detail-block-bottom-padding;
|
|
@@ -201,7 +202,7 @@ $dbx-step-block-badge-font-weight: 600;
|
|
|
201
202
|
display: flex;
|
|
202
203
|
align-items: center;
|
|
203
204
|
justify-content: center;
|
|
204
|
-
border-radius: var(--dbx-icon-tile-border-radius, 12px);
|
|
205
|
+
border-radius: var(--dbx-icon-tile-border-radius, var(--mat-sys-corner-medium, 12px));
|
|
205
206
|
padding: var(--dbx-icon-tile-padding, 8px);
|
|
206
207
|
width: var(--dbx-icon-tile-width);
|
|
207
208
|
height: var(--dbx-icon-tile-height);
|
|
@@ -216,6 +217,21 @@ $dbx-step-block-badge-font-weight: 600;
|
|
|
216
217
|
}
|
|
217
218
|
}
|
|
218
219
|
|
|
220
|
+
// Colored tile surface. `[dbxColor]` only provides the color tokens (and the
|
|
221
|
+
// `.dbx-color` marker); the tile itself paints from them here, scoped on the
|
|
222
|
+
// marker so a tile inside a `[dbxColor]` page section doesn't repaint from
|
|
223
|
+
// inherited tokens. Mirrors the `mat-card.dbx-color` model.
|
|
224
|
+
// `:not(.dbx-default)` guard: `[dbxColor]` always adds the `.dbx-color` marker,
|
|
225
|
+
// and a nullish color resolves to the `dbx-default` token class (which sets no
|
|
226
|
+
// `--dbx-bg-color-current`), so the guard keeps an uncolored tile from painting.
|
|
227
|
+
.dbx-icon-tile.dbx-color:not(.dbx-default) {
|
|
228
|
+
@include style.dbx-color-surface();
|
|
229
|
+
|
|
230
|
+
&.dbx-color-tonal {
|
|
231
|
+
color: var(#{theming.$dbx-bg-color-var});
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
219
235
|
// Round modifier — turns the rounded-square tile into a circle. Pair
|
|
220
236
|
// with explicit width/height (or square content) to keep it true round.
|
|
221
237
|
/// @dbx-utility icon-tile-round
|
|
@@ -243,7 +259,7 @@ $dbx-step-block-badge-font-weight: 600;
|
|
|
243
259
|
--dbx-icon-tile-width: var(--dbx-step-block-badge-size, #{$dbx-step-block-badge-size});
|
|
244
260
|
--dbx-icon-tile-height: var(--dbx-step-block-badge-size, #{$dbx-step-block-badge-size});
|
|
245
261
|
--dbx-icon-tile-min-width: var(--dbx-step-block-badge-size, #{$dbx-step-block-badge-size});
|
|
246
|
-
--dbx-icon-tile-font-size: var(--dbx-step-block-badge-font-size, #{$dbx-step-block-badge-font-size});
|
|
262
|
+
--dbx-icon-tile-font-size: var(--dbx-step-block-badge-font-size, var(--mat-sys-label-large-size, #{$dbx-step-block-badge-font-size}));
|
|
247
263
|
--dbx-icon-tile-font-weight: var(--dbx-step-block-badge-font-weight, #{$dbx-step-block-badge-font-weight});
|
|
248
264
|
--dbx-icon-tile-icon-size: var(--dbx-step-block-badge-icon-size, #{$dbx-step-block-badge-icon-size});
|
|
249
265
|
}
|
|
@@ -305,17 +321,36 @@ $dbx-step-block-badge-font-weight: 600;
|
|
|
305
321
|
}
|
|
306
322
|
|
|
307
323
|
/// @dbx-utility chip
|
|
308
|
-
/// @intent chip label — `<dbx-chip>` body that lays out
|
|
324
|
+
/// @intent chip label — `<dbx-chip>` body that lays out an inline-flex chip (label-large text, 7px/12px padding, 32px min-height) with an M3 corner-small radius; override the radius via `--dbx-chip-container-shape` (e.g. set it to `var(--mat-sys-corner-full)` to restore a pill). Compose with `.dbx-chip-small`, `.dbx-chip-block`, or `.dbx-chip-small-text` for size variants
|
|
309
325
|
/// @role layout
|
|
310
326
|
/// @component DbxChipDirective
|
|
311
327
|
/// @scope component-class
|
|
312
328
|
/// @see-also chip-spacer, chip-margin
|
|
313
329
|
.dbx-chip {
|
|
314
|
-
font-size:
|
|
315
|
-
font-weight:
|
|
330
|
+
font-size: var(--mat-sys-label-large-size);
|
|
331
|
+
font-weight: var(--mat-sys-label-large-weight);
|
|
316
332
|
position: relative;
|
|
317
333
|
box-sizing: border-box;
|
|
318
334
|
white-space: nowrap;
|
|
335
|
+
display: inline-flex;
|
|
336
|
+
align-items: center;
|
|
337
|
+
cursor: default;
|
|
338
|
+
padding: 7px 12px;
|
|
339
|
+
min-height: 32px;
|
|
340
|
+
border-radius: var(--dbx-chip-container-shape, var(--mat-chip-container-shape-radius, var(--mat-sys-corner-small, 8px)));
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/// @dbx-utility dot
|
|
344
|
+
/// @intent small round status dot painted from `currentColor` — pair with `[dbxTextColor]` (or any colored text context); size via `--dbx-dot-size`.
|
|
345
|
+
/// @role text
|
|
346
|
+
/// @see-also card-horizontal-header-dot, text-color, chip
|
|
347
|
+
.dbx-dot {
|
|
348
|
+
display: inline-block;
|
|
349
|
+
flex-shrink: 0;
|
|
350
|
+
width: var(--dbx-dot-size, 8px);
|
|
351
|
+
height: var(--dbx-dot-size, 8px);
|
|
352
|
+
border-radius: 50%;
|
|
353
|
+
background: currentColor;
|
|
319
354
|
}
|
|
320
355
|
|
|
321
356
|
/// @dbx-utility chip-spacer
|
|
@@ -326,21 +361,23 @@ $dbx-step-block-badge-font-weight: 600;
|
|
|
326
361
|
margin-right: $chip-spacing;
|
|
327
362
|
}
|
|
328
363
|
|
|
329
|
-
.dbx-chip
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
364
|
+
// Colored chip surface. `<dbx-chip>` hosts a DbxColorDirective that supplies the
|
|
365
|
+
// color tokens (named `dbx-{color}-bg` token class or inline config vars) and the
|
|
366
|
+
// `.dbx-color` marker; the chip directive supplies `--dbx-color-bg-tone` (default
|
|
367
|
+
// 18 → tonal). Painting happens here from those tokens. `:not(.dbx-default)`
|
|
368
|
+
// guard: the host directive always adds the `.dbx-color` marker, so an uncolored
|
|
369
|
+
// chip (marked `dbx-default`) must not paint. `.dbx-color-tonal` (tone < 100)
|
|
370
|
+
// flips the text to the vibrant color.
|
|
371
|
+
.dbx-chip.dbx-color:not(.dbx-default) {
|
|
372
|
+
@include style.dbx-color-surface(18%);
|
|
373
|
+
|
|
374
|
+
&.dbx-color-tonal {
|
|
375
|
+
color: var(#{theming.$dbx-bg-color-var});
|
|
376
|
+
}
|
|
339
377
|
}
|
|
340
378
|
|
|
341
|
-
.dbx-chip.dbx-chip-small
|
|
342
|
-
|
|
343
|
-
font-size: 12px;
|
|
379
|
+
.dbx-chip.dbx-chip-small {
|
|
380
|
+
font-size: var(--mat-sys-label-medium-size);
|
|
344
381
|
padding: 2px 8px;
|
|
345
382
|
min-height: 20px;
|
|
346
383
|
}
|
|
@@ -348,7 +385,7 @@ $dbx-step-block-badge-font-weight: 600;
|
|
|
348
385
|
.dbx-chip-small-text .dbx-chip,
|
|
349
386
|
.dbx-chip-small-text.dbx-chip,
|
|
350
387
|
.dbx-chip-small-text.dbx-chip.dbx-chip-small {
|
|
351
|
-
font-size: 10px;
|
|
388
|
+
font-size: var(--mat-sys-label-small-size, 10px);
|
|
352
389
|
}
|
|
353
390
|
|
|
354
391
|
.dbx-chip.dbx-chip-block {
|
|
@@ -453,13 +490,20 @@ $dbx-step-block-badge-font-weight: 600;
|
|
|
453
490
|
}
|
|
454
491
|
|
|
455
492
|
.dbx-number-with-limit {
|
|
456
|
-
padding:
|
|
493
|
+
padding: var(--dbx-padding-1) var(--dbx-padding-2);
|
|
457
494
|
|
|
458
495
|
.dbx-number-with-limit-divider {
|
|
459
496
|
margin: 0 3px;
|
|
460
497
|
}
|
|
461
498
|
}
|
|
462
499
|
|
|
500
|
+
// `<dbx-number-with-limit>` applies a ratio-derived `[dbxColor]` (ok/notice/warn)
|
|
501
|
+
// to itself; paint the colored pill from those tokens. The `:not(.dbx-default)`
|
|
502
|
+
// guard keeps the no-limit (uncolored) state from painting.
|
|
503
|
+
.dbx-number-with-limit.dbx-color:not(.dbx-default) {
|
|
504
|
+
@include style.dbx-color-surface();
|
|
505
|
+
}
|
|
506
|
+
|
|
463
507
|
.dbx-number-with-limit-rounded {
|
|
464
508
|
border-radius: var(--dbx-number-with-limit-container-shape, var(--mat-sys-corner-medium));
|
|
465
509
|
}
|
|
@@ -25,10 +25,17 @@ $linear-line-height: 4px;
|
|
|
25
25
|
|
|
26
26
|
.loading-progress-view-indicator {
|
|
27
27
|
background: none !important; // no background color
|
|
28
|
-
--mat-progress-spinner-active-indicator-color: #{$color-value};
|
|
29
28
|
}
|
|
30
29
|
|
|
31
|
-
|
|
30
|
+
// Colored progress indicator. `[dbxColor]` on the `<dbx-loading>` /
|
|
31
|
+
// `<dbx-basic-loading>` / `<dbx-loading-progress>` host supplies the
|
|
32
|
+
// `--dbx-bg-color-current` token + the `.dbx-color` marker; map the Material
|
|
33
|
+
// progress indicator colors to it. Scoped on the marker (no inheritance-only
|
|
34
|
+
// repaint). Without `[dbxColor]` the indicator keeps the Material default color.
|
|
35
|
+
dbx-loading.dbx-color,
|
|
36
|
+
dbx-basic-loading.dbx-color,
|
|
37
|
+
dbx-loading-progress.dbx-color {
|
|
38
|
+
--mat-progress-spinner-active-indicator-color: #{$color-value};
|
|
32
39
|
--mat-progress-bar-active-indicator-color: #{$color-value};
|
|
33
40
|
}
|
|
34
41
|
}
|
|
@@ -6,6 +6,20 @@
|
|
|
6
6
|
|
|
7
7
|
// MARK: Mixin
|
|
8
8
|
@mixin core() {
|
|
9
|
+
// Browser-tab style: each tab link rounds its TOP corners; the bar stays
|
|
10
|
+
// square. `--dbx-navbar-item-border-radius` holds a SINGLE radius ("how
|
|
11
|
+
// round"); the component owns the "top corners only" geometry by applying it
|
|
12
|
+
// as `R R 0 0`, so levers / app overrides can re-round the tabs without ever
|
|
13
|
+
// breaking the tab shape.
|
|
14
|
+
.dbx-navbar .mat-mdc-tab-nav-bar .mat-mdc-tab-link {
|
|
15
|
+
border-radius: var(--dbx-navbar-item-border-radius, var(--mat-sys-corner-large, 16px)) var(--dbx-navbar-item-border-radius, var(--mat-sys-corner-large, 16px)) 0 0;
|
|
16
|
+
// Clip the hover/focus state layer (`.mdc-tab__ripple::before`) and the
|
|
17
|
+
// click ripple (`.mat-mdc-tab-ripple`) to the rounded shape — neither
|
|
18
|
+
// inherits the radius. The keyboard-focus indicator pseudo is inset 5px so
|
|
19
|
+
// it stays clear of the clip, and the active underline sits on the square
|
|
20
|
+
// bottom edge (both unaffected).
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
}
|
|
9
23
|
}
|
|
10
24
|
|
|
11
25
|
@mixin theme($theme-config) {
|
|
@@ -26,7 +26,7 @@ $active-background-transparent-color: 0.93;
|
|
|
26
26
|
display: flex;
|
|
27
27
|
flex-direction: column;
|
|
28
28
|
box-sizing: border-box;
|
|
29
|
-
padding-bottom:
|
|
29
|
+
padding-bottom: var(--dbx-padding-5);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.dbx-anchor-list.mat-mdc-nav-list {
|
|
@@ -152,7 +152,7 @@ $active-background-transparent-color: 0.93;
|
|
|
152
152
|
--mat-sidenav-scrim-color: var(--dbx-sidenav-scrim-color, color-mix(in srgb, var(--mat-sys-neutral-variant20) 40%, transparent));
|
|
153
153
|
|
|
154
154
|
mat-sidenav.mat-drawer {
|
|
155
|
-
--mat-sidenav-container-text-color: var(--dbx-sidenav-text-color, var(--mat-sys-
|
|
155
|
+
--mat-sidenav-container-text-color: var(--dbx-sidenav-text-color, var(--dbx-color-current, var(--mat-sys-on-surface)));
|
|
156
156
|
--mat-sidenav-container-divider-color: var(--dbx-sidenav-divider-color, transparent);
|
|
157
157
|
background: var(--dbx-sidenav-background, var(--dbx-bg-color-current));
|
|
158
158
|
|
package/lib/style/_core.scss
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use './all-core';
|
|
3
3
|
@use './all-typography';
|
|
4
|
+
@use './corners';
|
|
4
5
|
@use './root-variables';
|
|
5
6
|
@use './config';
|
|
6
7
|
|
|
@@ -11,5 +12,8 @@
|
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
@include all-core.all-component-core($theme-config);
|
|
15
|
+
// Generic corner helpers — emitted AFTER all-component-core() so these
|
|
16
|
+
// single-class utilities win source-order ties against component baselines.
|
|
17
|
+
@include corners.core();
|
|
14
18
|
@include root-variables.root-variables('body', $theme-config);
|
|
15
19
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// MARK: Generic corner-rounding helpers
|
|
2
|
+
//
|
|
3
|
+
// Single-class utilities for applying an M3 corner radius to any element. The
|
|
4
|
+
// base `.dbx-corners` reads the app-overridable `--dbx-corners-border-radius`
|
|
5
|
+
// token (root-emitted to the M3 "medium" radius in `_root-variables.scss`,
|
|
6
|
+
// alongside the content-pit radius token) so it tracks the corner system and
|
|
7
|
+
// the style-demo levers; the explicit level variants are self-sufficient fixed
|
|
8
|
+
// design choices that bypass the token.
|
|
9
|
+
//
|
|
10
|
+
// Emitted by `core()`, which `_core.scss` includes AFTER `all-component-core()`
|
|
11
|
+
// so these single-class helpers win source-order ties against component-level
|
|
12
|
+
// shape baselines (e.g. the content-pit default).
|
|
13
|
+
|
|
14
|
+
@use './theming';
|
|
15
|
+
|
|
16
|
+
// MARK: Mixin
|
|
17
|
+
@mixin core() {
|
|
18
|
+
/// @dbx-utility corners
|
|
19
|
+
/// @intent rounded-corner surface — applies the M3 "medium" corner radius via the app-overridable `--dbx-corners-border-radius` token, so it tracks the corner system / style-demo levers
|
|
20
|
+
/// @role layout
|
|
21
|
+
/// @see-also dbx-corners-small, dbx-corners-medium, dbx-corners-large, dbx-corners-extra-large, dbx-corners-full, dbx-corners-none
|
|
22
|
+
.dbx-corners {
|
|
23
|
+
border-radius: theming.$dbx-corners-border-radius;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Level variants are self-sufficient (no `.dbx-corners` base required) and
|
|
27
|
+
// deliberately bypass the token: an explicit level is a fixed design choice.
|
|
28
|
+
|
|
29
|
+
/// @dbx-utility corners-small
|
|
30
|
+
/// @intent fixed M3 "small" (8px) corner radius — explicit, token-independent level choice
|
|
31
|
+
/// @role layout
|
|
32
|
+
/// @see-also dbx-corners
|
|
33
|
+
.dbx-corners-small {
|
|
34
|
+
border-radius: var(--mat-sys-corner-small, 8px);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/// @dbx-utility corners-medium
|
|
38
|
+
/// @intent fixed M3 "medium" (12px) corner radius — explicit, token-independent level choice
|
|
39
|
+
/// @role layout
|
|
40
|
+
/// @see-also dbx-corners
|
|
41
|
+
.dbx-corners-medium {
|
|
42
|
+
border-radius: var(--mat-sys-corner-medium, 12px);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/// @dbx-utility corners-large
|
|
46
|
+
/// @intent fixed M3 "large" (16px) corner radius — explicit, token-independent level choice
|
|
47
|
+
/// @role layout
|
|
48
|
+
/// @see-also dbx-corners
|
|
49
|
+
.dbx-corners-large {
|
|
50
|
+
border-radius: var(--mat-sys-corner-large, 16px);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/// @dbx-utility corners-extra-large
|
|
54
|
+
/// @intent fixed M3 "extra-large" (28px) corner radius — explicit, token-independent level choice
|
|
55
|
+
/// @role layout
|
|
56
|
+
/// @see-also dbx-corners
|
|
57
|
+
.dbx-corners-extra-large {
|
|
58
|
+
border-radius: var(--mat-sys-corner-extra-large, 28px);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/// @dbx-utility corners-full
|
|
62
|
+
/// @intent fixed M3 "full" (pill) corner radius — explicit, token-independent level choice
|
|
63
|
+
/// @role layout
|
|
64
|
+
/// @see-also dbx-corners
|
|
65
|
+
.dbx-corners-full {
|
|
66
|
+
border-radius: var(--mat-sys-corner-full, 9999px);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/// @dbx-utility corners-none
|
|
70
|
+
/// @intent square corners (radius 0) — doubles as the common opt-out for components that round by default (e.g. `.dbx-content-pit`)
|
|
71
|
+
/// @role layout
|
|
72
|
+
/// @see-also dbx-corners, dbx-content-pit
|
|
73
|
+
.dbx-corners-none {
|
|
74
|
+
border-radius: 0;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@mixin theme($theme-config) {
|
|
79
|
+
}
|
|
@@ -30,7 +30,24 @@
|
|
|
30
30
|
#{theming.$dbx-page-height-additional-offset-var}: 0px;
|
|
31
31
|
#{theming.$dbx-content-height-additional-offset-var}: 0px;
|
|
32
32
|
|
|
33
|
+
// M3 shape-scale system tokens. `mat.theme()` emits these, but the `mat.define-theme()`-based
|
|
34
|
+
// API does not — emit them so `var(--mat-sys-corner-*)` references resolve.
|
|
35
|
+
// Values mirror @angular/material/core/tokens/m3/_md-sys-shape.scss.
|
|
36
|
+
--mat-sys-corner-none: 0;
|
|
37
|
+
--mat-sys-corner-extra-small: 4px;
|
|
38
|
+
--mat-sys-corner-extra-small-top: 4px 4px 0 0;
|
|
39
|
+
--mat-sys-corner-small: 8px;
|
|
40
|
+
--mat-sys-corner-medium: 12px;
|
|
41
|
+
--mat-sys-corner-large: 16px;
|
|
42
|
+
--mat-sys-corner-large-start: 16px 0 0 16px;
|
|
43
|
+
--mat-sys-corner-large-end: 0 16px 16px 0;
|
|
44
|
+
--mat-sys-corner-large-top: 16px 16px 0 0;
|
|
45
|
+
--mat-sys-corner-extra-large: 28px;
|
|
46
|
+
--mat-sys-corner-extra-large-top: 28px 28px 0 0;
|
|
47
|
+
--mat-sys-corner-full: 9999px;
|
|
48
|
+
|
|
33
49
|
#{theming.$dbx-content-pit-rounded-border-radius-var}: var(--mat-sys-corner-medium);
|
|
50
|
+
#{theming.$dbx-corners-border-radius-var}: var(--mat-sys-corner-medium);
|
|
34
51
|
#{theming.$dbx-content-pit-scrollable-max-height-var}: 140px;
|
|
35
52
|
|
|
36
53
|
#{theming.$dbx-avatar-size-var}: theming.get-dbx-avatar-size($theme-config);
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/// Applies M3 "small" (8px) corner rounding to components that default to
|
|
2
|
+
/// larger radii in M3 (buttons default to "full"/pill, dialogs to 28px, etc).
|
|
3
|
+
/// This gives a modern but restrained look.
|
|
4
|
+
@mixin dbx-components-shapes() {
|
|
5
|
+
// Buttons: M3 default is "full" (pill). Small = 8px.
|
|
6
|
+
--mat-button-filled-container-shape: 8px;
|
|
7
|
+
--mat-button-outlined-container-shape: 8px;
|
|
8
|
+
--mat-button-text-container-shape: 8px;
|
|
9
|
+
--mat-button-protected-container-shape: 8px;
|
|
10
|
+
--mat-button-tonal-container-shape: 8px;
|
|
11
|
+
|
|
12
|
+
// FAB: M3 default is "large" (16px). Small = 8px.
|
|
13
|
+
--mat-fab-container-shape: 8px;
|
|
14
|
+
--mat-fab-small-container-shape: 8px;
|
|
15
|
+
|
|
16
|
+
// Dialog: M3 default is "extra-large" (28px). Small = 8px.
|
|
17
|
+
--mat-dialog-container-shape: 8px;
|
|
18
|
+
|
|
19
|
+
// Card: M3 default is "medium" (12px). Small = 8px.
|
|
20
|
+
--mat-card-elevated-container-shape: 8px;
|
|
21
|
+
--mat-card-filled-container-shape: 8px;
|
|
22
|
+
--mat-card-outlined-container-shape: 8px;
|
|
23
|
+
|
|
24
|
+
// Sidenav: M3 default is "large" (16px). No rounding for dbx-components.
|
|
25
|
+
--mat-sidenav-container-shape: 0;
|
|
26
|
+
|
|
27
|
+
// Chip: Small = 8px.
|
|
28
|
+
--mat-chip-container-shape-radius: 8px;
|
|
29
|
+
|
|
30
|
+
// Form fields: Small = 8px.
|
|
31
|
+
--mat-form-field-filled-container-shape: 8px;
|
|
32
|
+
--mat-form-field-outlined-container-shape: 8px;
|
|
33
|
+
|
|
34
|
+
// Snackbar: Small = 8px.
|
|
35
|
+
--mat-snack-bar-container-shape: 8px;
|
|
36
|
+
|
|
37
|
+
// Menu / Select / Autocomplete: Small = 8px.
|
|
38
|
+
--mat-menu-container-shape: 8px;
|
|
39
|
+
--mat-autocomplete-container-shape: 8px;
|
|
40
|
+
|
|
41
|
+
// Expansion panel
|
|
42
|
+
--mat-expansion-container-shape: 8px;
|
|
43
|
+
|
|
44
|
+
// Datepicker
|
|
45
|
+
--mat-datepicker-calendar-container-shape: 8px;
|
|
46
|
+
|
|
47
|
+
// Bottom sheet
|
|
48
|
+
--mat-bottom-sheet-container-shape: 8px;
|
|
49
|
+
|
|
50
|
+
// Tooltip
|
|
51
|
+
--mat-tooltip-container-shape: 8px;
|
|
52
|
+
|
|
53
|
+
// List item rounding (active indicator + container shape) is intentionally NOT pinned here —
|
|
54
|
+
// it is owned by the dbx-list / dbx-anchor-list component rules in `_list.scss` (medium default
|
|
55
|
+
// via `--dbx-list-item-border-radius`), so each list type controls its own radius.
|
|
56
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
// MARK: Style Demo (disposable demo/debug classes)
|
|
2
|
+
//
|
|
3
|
+
// These `.dbx-style-demo-template-<key>` classes back the `className` levers in
|
|
4
|
+
// `@dereekb/dbx-web/style-demo` (DbxStyleDemoStyleTemplate.className). They are
|
|
5
|
+
// DISPOSABLE demo/debug classes: they exist only to drive the styling showcase /
|
|
6
|
+
// live token-override preview harness and should be removed once the styling
|
|
7
|
+
// migration they support is complete. They are NOT a dbx-web core runtime primitive.
|
|
8
|
+
//
|
|
9
|
+
// Each template re-points CSS custom properties; values reference `--mat-sys-*`
|
|
10
|
+
// tokens (per the component-token convention) except where an intentional demo
|
|
11
|
+
// override value (e.g. an exaggerated corner radius) is the whole point of the lever.
|
|
12
|
+
//
|
|
13
|
+
// Authored like `_shapes.scss` as an opt-in mixin and emitted via an
|
|
14
|
+
// `@each` map loop (the `_curated-colors.scss` pattern). Include the mixin once at a
|
|
15
|
+
// global/root scope; the `var(--mat-sys-*)` references resolve per-theme at use-site,
|
|
16
|
+
// so a single emission works under both light and dark themes.
|
|
17
|
+
|
|
18
|
+
/// Builds the component-shape token override map for a single corner-radius value.
|
|
19
|
+
///
|
|
20
|
+
/// Re-points the same Material component shape tokens that `dbx-components-shapes()` pins to the
|
|
21
|
+
/// baseline `8px`, plus the dbx component corner tokens that track the system scale
|
|
22
|
+
/// (`--dbx-content-pit-rounded-border-radius`, `--dbx-prompt-box-border-radius`,
|
|
23
|
+
/// `--dbx-corners-border-radius`, `--dbx-navbar-item-border-radius`).
|
|
24
|
+
///
|
|
25
|
+
/// EXCEPT the intentional `--mat-sidenav-container-shape` (0) and `--mat-list-active-indicator-shape`
|
|
26
|
+
/// (2px global pin) entries — those keep their deliberate non-default shapes. For the same reason
|
|
27
|
+
/// `--dbx-list-item-border-radius` (the `.dbx-list` row radius; medium default) and
|
|
28
|
+
/// `--dbx-list-item-card-border-radius` (card-list rows) stay excluded here — they are owned by the list
|
|
29
|
+
/// component, re-rounded only by the `pill-controls` (`--dbx-list-item-border-radius` only) and the
|
|
30
|
+
/// dedicated `list-corner-*` levers (both list tokens).
|
|
31
|
+
///
|
|
32
|
+
/// `$value` may be a literal (e.g. `0`) or a token reference (e.g. `var(--mat-sys-corner-medium)`); the
|
|
33
|
+
/// emitting mixin interpolates either form via `#{$value}`. Private to this module (`-` prefix).
|
|
34
|
+
@function -dbx-style-demo-shape-map($value) {
|
|
35
|
+
@return (
|
|
36
|
+
'--mat-button-filled-container-shape': $value,
|
|
37
|
+
'--mat-button-outlined-container-shape': $value,
|
|
38
|
+
'--mat-button-text-container-shape': $value,
|
|
39
|
+
'--mat-button-protected-container-shape': $value,
|
|
40
|
+
'--mat-button-tonal-container-shape': $value,
|
|
41
|
+
'--mat-fab-container-shape': $value,
|
|
42
|
+
'--mat-fab-small-container-shape': $value,
|
|
43
|
+
'--mat-dialog-container-shape': $value,
|
|
44
|
+
'--mat-card-elevated-container-shape': $value,
|
|
45
|
+
'--mat-card-filled-container-shape': $value,
|
|
46
|
+
'--mat-card-outlined-container-shape': $value,
|
|
47
|
+
'--mat-chip-container-shape-radius': $value,
|
|
48
|
+
'--mat-form-field-filled-container-shape': $value,
|
|
49
|
+
'--mat-form-field-outlined-container-shape': $value,
|
|
50
|
+
'--mat-snack-bar-container-shape': $value,
|
|
51
|
+
'--mat-menu-container-shape': $value,
|
|
52
|
+
'--mat-autocomplete-container-shape': $value,
|
|
53
|
+
'--mat-expansion-container-shape': $value,
|
|
54
|
+
'--mat-datepicker-calendar-container-shape': $value,
|
|
55
|
+
'--mat-bottom-sheet-container-shape': $value,
|
|
56
|
+
'--mat-tooltip-container-shape': $value,
|
|
57
|
+
// dbx component corner tokens that track the system scale.
|
|
58
|
+
'--dbx-content-pit-rounded-border-radius': $value,
|
|
59
|
+
'--dbx-prompt-box-border-radius': $value,
|
|
60
|
+
'--dbx-corners-border-radius': $value,
|
|
61
|
+
'--dbx-navbar-item-border-radius': $value // single radius; navbar keeps its top-only geometry
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/// Builds the controls-only shape override map for a single corner-radius value.
|
|
66
|
+
///
|
|
67
|
+
/// Backs the `pill-controls` lever: re-rounds only the interactive "controls" surfaces (buttons, FABs,
|
|
68
|
+
/// `.dbx-list` rows via `--dbx-list-item-border-radius`, and `.dbx-anchor-list` rows via
|
|
69
|
+
/// `--dbx-anchor-list-item-border-radius`) without touching content surfaces. The sidenav anchor list keeps
|
|
70
|
+
/// its own token. Chips and form-fields are intentionally excluded — pilling them reads as a different design
|
|
71
|
+
/// intent than rounding controls. Private to this module (`-` prefix).
|
|
72
|
+
@function -dbx-style-demo-controls-shape-map($value) {
|
|
73
|
+
@return (
|
|
74
|
+
'--mat-button-filled-container-shape': $value,
|
|
75
|
+
'--mat-button-outlined-container-shape': $value,
|
|
76
|
+
'--mat-button-text-container-shape': $value,
|
|
77
|
+
'--mat-button-protected-container-shape': $value,
|
|
78
|
+
'--mat-button-tonal-container-shape': $value,
|
|
79
|
+
'--mat-fab-container-shape': $value,
|
|
80
|
+
'--mat-fab-small-container-shape': $value,
|
|
81
|
+
'--mat-list-active-indicator-shape': $value,
|
|
82
|
+
// list + nav/anchor-list rows (each list type reads its own token)
|
|
83
|
+
'--dbx-list-item-border-radius': $value,
|
|
84
|
+
'--dbx-anchor-list-item-border-radius': $value
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/// Builds the button-only shape override map for a single corner-radius value.
|
|
89
|
+
///
|
|
90
|
+
/// Backs the `button-corner-*` levers: re-rounds only the 5 `--mat-button-*-container-shape` tokens,
|
|
91
|
+
/// leaving FABs / cards / lists / form-fields / etc. untouched. Composes on top of a
|
|
92
|
+
/// `corner-shape-*` / `pill-controls` lever — emitted later in `$dbx-style-demo-templates` so this map
|
|
93
|
+
/// wins the `--mat-button-*` tokens it shares with them. Private to this module (`-` prefix).
|
|
94
|
+
@function -dbx-style-demo-button-shape-map($value) {
|
|
95
|
+
@return ('--mat-button-filled-container-shape': $value, '--mat-button-outlined-container-shape': $value, '--mat-button-text-container-shape': $value, '--mat-button-protected-container-shape': $value, '--mat-button-tonal-container-shape': $value);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/// Builds the dbx-list-only shape override map for a single corner-radius value.
|
|
99
|
+
///
|
|
100
|
+
/// Backs the `list-corner-*` levers: re-points the default `.dbx-list` row radius
|
|
101
|
+
/// (`--dbx-list-item-border-radius`, medium by default) and card-list rows (`--dbx-list-item-card-border-radius`)
|
|
102
|
+
/// — the two list tokens that `-dbx-style-demo-shape-map` deliberately excludes — without touching any other
|
|
103
|
+
/// surface. Composes on top of `pill-controls` (emitted later → wins `--dbx-list-item-border-radius`).
|
|
104
|
+
/// Private to this module (`-` prefix).
|
|
105
|
+
@function -dbx-style-demo-list-shape-map($value) {
|
|
106
|
+
@return ('--dbx-list-item-border-radius': $value, '--dbx-list-item-card-border-radius': $value);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/// Builds the dbx-anchor-list-only shape override map for a single corner-radius value.
|
|
110
|
+
///
|
|
111
|
+
/// Backs the `anchor-list-corner-*` levers: re-points the default `.dbx-anchor-list` (nav) row radius
|
|
112
|
+
/// (`--dbx-anchor-list-item-border-radius`, medium by default) independently of `.dbx-list` and the sidenav
|
|
113
|
+
/// anchor list — which carry their own tokens. Private to this module (`-` prefix).
|
|
114
|
+
@function -dbx-style-demo-anchor-list-shape-map($value) {
|
|
115
|
+
@return ('--dbx-anchor-list-item-border-radius': $value);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/// Map of demo template key -> CSS custom-property overrides emitted for that template's debug class.
|
|
119
|
+
$dbx-style-demo-templates: (
|
|
120
|
+
// M3 corner-radius scale levers. Each re-points the component shape tokens that `dbx-components-shapes()`
|
|
121
|
+
// pins to the baseline 8px, so cards / buttons / form-fields / etc. re-round live as the lever flips.
|
|
122
|
+
// Values reference the `--mat-sys-corner-*` token where one exists; `none` is the literal 0.
|
|
123
|
+
// 'corner-shape-small' is intentionally omitted — the baseline is already 8px (= small), so it would be a no-op.
|
|
124
|
+
// 'corner-shape-full' was removed — pilling every surface broke too many components; use the
|
|
125
|
+
// controls-only 'pill-controls' lever below instead.
|
|
126
|
+
'corner-shape-none': -dbx-style-demo-shape-map(0),
|
|
127
|
+
'corner-shape-extra-small': -dbx-style-demo-shape-map(var(--mat-sys-corner-extra-small)),
|
|
128
|
+
'corner-shape-medium': -dbx-style-demo-shape-map(var(--mat-sys-corner-medium)),
|
|
129
|
+
'corner-shape-large': -dbx-style-demo-shape-map(var(--mat-sys-corner-large)),
|
|
130
|
+
'corner-shape-extra-large': -dbx-style-demo-shape-map(var(--mat-sys-corner-extra-large)),
|
|
131
|
+
// Controls-only pill preset. Emitted AFTER the corner-shape-* entries so that when it is composed
|
|
132
|
+
// with a corner lever (its own toggle group, not 'Shape'), this later emission wins the tokens they
|
|
133
|
+
// share (buttons / FABs / list items) — guard this ordering when reordering the map.
|
|
134
|
+
'pill-controls': -dbx-style-demo-controls-shape-map(var(--mat-sys-corner-full)),
|
|
135
|
+
// Button-only corner levers (own 'Button Shape' toggle group). Emitted AFTER the corner-shape-* /
|
|
136
|
+
// pill-controls levers so this later emission wins the shared --mat-button-* shape tokens when composed
|
|
137
|
+
// (e.g. corner-shape-large + button-corner-none → buttons square, everything else large). Baseline is
|
|
138
|
+
// 8px (= small) so 'small' is omitted as a no-op; 'extra-small' (4px) is the meaningful step down.
|
|
139
|
+
'button-corner-none': -dbx-style-demo-button-shape-map(0),
|
|
140
|
+
'button-corner-extra-small': -dbx-style-demo-button-shape-map(var(--mat-sys-corner-extra-small)),
|
|
141
|
+
'button-corner-medium': -dbx-style-demo-button-shape-map(var(--mat-sys-corner-medium)),
|
|
142
|
+
'button-corner-large': -dbx-style-demo-button-shape-map(var(--mat-sys-corner-large)),
|
|
143
|
+
'button-corner-extra-large': -dbx-style-demo-button-shape-map(var(--mat-sys-corner-extra-large)),
|
|
144
|
+
// dbx-list-only corner levers (own 'List Shape' toggle group). Re-point the list item tokens that
|
|
145
|
+
// -dbx-style-demo-shape-map deliberately excludes; emitted after pill-controls so they win the shared
|
|
146
|
+
// --dbx-list-item-border-radius. The .dbx-list default is medium, so 'small' (8px) is meaningful and
|
|
147
|
+
// 'extra-small' is omitted.
|
|
148
|
+
'list-corner-none': -dbx-style-demo-list-shape-map(0),
|
|
149
|
+
'list-corner-small': -dbx-style-demo-list-shape-map(var(--mat-sys-corner-small)),
|
|
150
|
+
'list-corner-medium': -dbx-style-demo-list-shape-map(var(--mat-sys-corner-medium)),
|
|
151
|
+
'list-corner-large': -dbx-style-demo-list-shape-map(var(--mat-sys-corner-large)),
|
|
152
|
+
'list-corner-extra-large': -dbx-style-demo-list-shape-map(var(--mat-sys-corner-extra-large)),
|
|
153
|
+
// dbx-anchor-list-only corner levers (own 'Anchor List Shape' toggle group), independent of list-corner-*
|
|
154
|
+
// (anchor lists read their own --dbx-anchor-list-item-border-radius token). Same medium-baseline scale.
|
|
155
|
+
'anchor-list-corner-none': -dbx-style-demo-anchor-list-shape-map(0),
|
|
156
|
+
'anchor-list-corner-small': -dbx-style-demo-anchor-list-shape-map(var(--mat-sys-corner-small)),
|
|
157
|
+
'anchor-list-corner-medium': -dbx-style-demo-anchor-list-shape-map(var(--mat-sys-corner-medium)),
|
|
158
|
+
'anchor-list-corner-large': -dbx-style-demo-anchor-list-shape-map(var(--mat-sys-corner-large)),
|
|
159
|
+
'anchor-list-corner-extra-large': -dbx-style-demo-anchor-list-shape-map(var(--mat-sys-corner-extra-large)),
|
|
160
|
+
// Tints surfaces toward the primary color by mixing the theme's own system tokens — stays theme-correct.
|
|
161
|
+
'surface-tint': (
|
|
162
|
+
'--mat-sys-surface': color-mix(in srgb, var(--mat-sys-primary) 8%, var(--mat-sys-surface)),
|
|
163
|
+
'--mat-sys-surface-container': color-mix(in srgb, var(--mat-sys-primary) 12%, var(--mat-sys-surface-container)),
|
|
164
|
+
'--mat-sys-surface-container-high': color-mix(in srgb, var(--mat-sys-primary) 16%, var(--mat-sys-surface-container-high))
|
|
165
|
+
)
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
/// Opt-in mixin that emits the disposable `.dbx-style-demo-template-<key>` debug classes.
|
|
169
|
+
///
|
|
170
|
+
/// Usage (include once at a global/root scope):
|
|
171
|
+
/// ```scss
|
|
172
|
+
/// @use '@dereekb/dbx-web' as dbx;
|
|
173
|
+
/// @include dbx.dbx-style-demo-debug-classes();
|
|
174
|
+
/// ```
|
|
175
|
+
@mixin dbx-style-demo-debug-classes() {
|
|
176
|
+
@each $key, $tokens in $dbx-style-demo-templates {
|
|
177
|
+
.dbx-style-demo-template-#{$key} {
|
|
178
|
+
@each $token, $value in $tokens {
|
|
179
|
+
#{$token}: #{$value};
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
@@ -323,13 +323,20 @@ $dbx-outline-color: var($dbx-outline-color-var);
|
|
|
323
323
|
$dbx-outline-variant-color: var($dbx-outline-variant-color-var);
|
|
324
324
|
$dbx-error-color: var($dbx-error-color-var);
|
|
325
325
|
|
|
326
|
-
/// Border radius for the `[dbxContentPit]
|
|
326
|
+
/// Border radius for the `[dbxContentPit]`, applied by default to every pit. Defaults to `var(--mat-sys-corner-medium)`.
|
|
327
327
|
/// @intent pit radius, rounded pit corner, content pit radius
|
|
328
328
|
/// @role radius
|
|
329
329
|
/// @see --mat-sys-corner-medium
|
|
330
330
|
$dbx-content-pit-rounded-border-radius-var: --dbx-content-pit-rounded-border-radius;
|
|
331
331
|
$dbx-content-pit-rounded-border-radius: var($dbx-content-pit-rounded-border-radius-var);
|
|
332
332
|
|
|
333
|
+
/// Border radius for the generic `.dbx-corners` utility class. Defaults to `var(--mat-sys-corner-medium)`.
|
|
334
|
+
/// @intent corners radius, generic corner radius, dbx-corners radius
|
|
335
|
+
/// @role radius
|
|
336
|
+
/// @see --mat-sys-corner-medium
|
|
337
|
+
$dbx-corners-border-radius-var: --dbx-corners-border-radius;
|
|
338
|
+
$dbx-corners-border-radius: var($dbx-corners-border-radius-var);
|
|
339
|
+
|
|
333
340
|
$dbx-content-pit-scrollable-max-height-var: --dbx-content-pit-scrollable-max-height;
|
|
334
341
|
$dbx-content-pit-scrollable-max-height: var($dbx-content-pit-scrollable-max-height-var);
|
|
335
342
|
|