@rcarls/rc-theme-material 0.4.2 → 0.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/CHANGELOG.md +58 -0
- package/README.md +50 -0
- package/bridge.css +18 -0
- package/components/adaptive-menu.css +162 -0
- package/components/app-bar.css +45 -5
- package/components/bottom-sheet.css +8 -5
- package/components/button.css +213 -1
- package/components/carousel.css +23 -0
- package/components/chip-group.css +15 -0
- package/components/combobox.css +7 -0
- package/components/dialog.css +62 -1
- package/components/icons.css +39 -6
- package/components/list-item.css +79 -31
- package/components/menu-button.css +101 -0
- package/components/menu.css +30 -1
- package/components/modes.css +14 -12
- package/components/progress.css +10 -0
- package/components/range-slider.css +7 -3
- package/components/scroller.css +7 -0
- package/components/segmented-button.css +1 -0
- package/components/select.css +7 -0
- package/components/textarea.css +8 -2
- package/components/virtual-canvas.css +4 -1
- package/components.css +5 -0
- package/constraints/material.json +99 -0
- package/defaults.css +140 -11
- package/package.json +6 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@layer rc-theme-material.components {
|
|
2
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-chip-group {
|
|
3
|
+
--rc-chip-group-column-gap: 0.5rem;
|
|
4
|
+
--rc-chip-group-row-gap: 0;
|
|
5
|
+
--rc-chip-group-padding-block: 0;
|
|
6
|
+
--rc-chip-group-scroll-padding-inline: 0;
|
|
7
|
+
--rc-chip-group-scrollbar-width: none;
|
|
8
|
+
--rc-chip-group-toggle-gap: 0.5rem;
|
|
9
|
+
--rc-chip-group-toggle-separator-gap: 0.5rem;
|
|
10
|
+
--rc-chip-group-toggle-icon-size: 1.125rem;
|
|
11
|
+
--rc-chip-group-toggle-separator-block-size: 1.5rem;
|
|
12
|
+
--rc-chip-group-toggle-separator-inline-size: 1px;
|
|
13
|
+
--rc-chip-group-toggle-separator-color: var(--md-sys-color-outline-variant, currentColor);
|
|
14
|
+
}
|
|
15
|
+
}
|
package/components/combobox.css
CHANGED
|
@@ -28,6 +28,13 @@
|
|
|
28
28
|
color: var(--md-sys-color-on-surface-variant, ButtonText);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-combobox::part(chips) {
|
|
32
|
+
--rc-chip-block-size: 2rem;
|
|
33
|
+
--rc-chip-touch-target-block-size: 3rem;
|
|
34
|
+
--rc-chip-radius: var(--md-sys-shape-corner-small, 0.5rem);
|
|
35
|
+
--rc-chip-remove-target-size: 1.5rem;
|
|
36
|
+
}
|
|
37
|
+
|
|
31
38
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-combobox::part(toggle) {
|
|
32
39
|
border-radius: var(--md-sys-shape-corner-full, 999px);
|
|
33
40
|
color: var(
|
package/components/dialog.css
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
@layer rc-theme-material.components {
|
|
2
2
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-dialog > dialog {
|
|
3
3
|
max-inline-size: min(35rem, calc(100vw - 3rem));
|
|
4
|
+
/* A native <dialog>'s own default max-block-size/overflow:auto is what
|
|
5
|
+
* would otherwise constrain a tall dialog's height, but Chromium does
|
|
6
|
+
* not reliably clip a scrolling element's own border-radius once it
|
|
7
|
+
* actually needs to scroll (confirmed: a short dialog renders correctly
|
|
8
|
+
* rounded on every edge; the same dialog forced to overflow its
|
|
9
|
+
* available height loses the radius on whichever edge sits at the
|
|
10
|
+
* scroll boundary). Setting an explicit max-block-size plus
|
|
11
|
+
* overflow: hidden here replaces that reliance: this outer surface
|
|
12
|
+
* never itself scrolls, so its own corners always clip correctly, and
|
|
13
|
+
* a scrollable dialog instead scrolls a dedicated inner region. */
|
|
14
|
+
max-block-size: calc(100dvh - 3rem);
|
|
15
|
+
overflow: hidden;
|
|
4
16
|
padding: 1.5rem;
|
|
5
17
|
border: 0;
|
|
6
18
|
border-radius: var(--md-sys-shape-corner-extra-large, 1.75rem);
|
|
@@ -17,10 +29,59 @@
|
|
|
17
29
|
);
|
|
18
30
|
}
|
|
19
31
|
|
|
32
|
+
/*
|
|
33
|
+
* Fallback styling for plain, unwrapped buttons in dialog content or
|
|
34
|
+
* actions. Descendants of a defined custom element are excluded because
|
|
35
|
+
* that wrapper owns its native control's presentation. The :where() list
|
|
36
|
+
* identifies native grouping elements that commonly organize dialog
|
|
37
|
+
* content; unlike autonomous custom elements, they should not suppress
|
|
38
|
+
* the fallback treatment.
|
|
39
|
+
*/
|
|
20
40
|
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
21
41
|
rc-dialog
|
|
22
42
|
> dialog
|
|
23
|
-
:is(button, [role='button'])
|
|
43
|
+
:is(button, [role='button']):not(
|
|
44
|
+
rc-dialog
|
|
45
|
+
> dialog
|
|
46
|
+
:defined:not(
|
|
47
|
+
:where(
|
|
48
|
+
address,
|
|
49
|
+
article,
|
|
50
|
+
aside,
|
|
51
|
+
blockquote,
|
|
52
|
+
dd,
|
|
53
|
+
details,
|
|
54
|
+
div,
|
|
55
|
+
dl,
|
|
56
|
+
dt,
|
|
57
|
+
fieldset,
|
|
58
|
+
figcaption,
|
|
59
|
+
figure,
|
|
60
|
+
footer,
|
|
61
|
+
form,
|
|
62
|
+
header,
|
|
63
|
+
hgroup,
|
|
64
|
+
li,
|
|
65
|
+
main,
|
|
66
|
+
menu,
|
|
67
|
+
nav,
|
|
68
|
+
ol,
|
|
69
|
+
p,
|
|
70
|
+
search,
|
|
71
|
+
section,
|
|
72
|
+
span,
|
|
73
|
+
table,
|
|
74
|
+
tbody,
|
|
75
|
+
td,
|
|
76
|
+
tfoot,
|
|
77
|
+
th,
|
|
78
|
+
thead,
|
|
79
|
+
tr,
|
|
80
|
+
ul
|
|
81
|
+
)
|
|
82
|
+
)
|
|
83
|
+
*
|
|
84
|
+
) {
|
|
24
85
|
min-block-size: 2.5rem;
|
|
25
86
|
padding-inline: 1.5rem;
|
|
26
87
|
border: 0;
|
package/components/icons.css
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
@layer rc-theme-material.components {
|
|
2
2
|
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
3
|
-
:where(
|
|
4
|
-
[data-rc-icon],
|
|
5
|
-
[data-rc-button-icon],
|
|
6
|
-
[data-rc-button-selected-icon],
|
|
7
|
-
[data-rc-navigation-icon]
|
|
8
|
-
) {
|
|
3
|
+
:where([data-rc-icon], [data-rc-navigation-icon]) {
|
|
9
4
|
display: inline-grid;
|
|
10
5
|
place-items: center;
|
|
11
6
|
font-size: var(--rc-icon-font-size, 1.5rem);
|
|
@@ -16,4 +11,42 @@
|
|
|
16
11
|
*/
|
|
17
12
|
line-height: var(--rc-icon-font-line-height, var(--rc-icon-font-size, 1.5rem)) !important;
|
|
18
13
|
}
|
|
14
|
+
|
|
15
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
16
|
+
:where([data-rc-button-icon], [data-rc-button-selected-icon], [data-rc-chip-icon]) {
|
|
17
|
+
display: inline-grid;
|
|
18
|
+
place-items: center;
|
|
19
|
+
font-size: var(--rc-compact-icon-font-size, 1.125rem);
|
|
20
|
+
line-height: var(
|
|
21
|
+
--rc-compact-icon-font-line-height,
|
|
22
|
+
var(--rc-compact-icon-font-size, 1.125rem)
|
|
23
|
+
) !important;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
27
|
+
rc-button[icon-only]
|
|
28
|
+
:where([data-rc-button-icon], [data-rc-button-selected-icon]) {
|
|
29
|
+
font-size: var(--rc-icon-button-icon-font-size, 1.5rem);
|
|
30
|
+
line-height: var(--rc-icon-button-icon-font-size, 1.5rem) !important;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/*
|
|
34
|
+
* An icon-only button's marker attributes (above) are an opt-in contract:
|
|
35
|
+
* a consumer's icon element has to know to carry `data-rc-button-icon`.
|
|
36
|
+
* When it doesn't (an <svg>, an <iconify-icon>, and similar),
|
|
37
|
+
* that icon would otherwise silently inherit the button's label font-size
|
|
38
|
+
* instead of the icon-button icon size. rc-button only sets `icon-only`
|
|
39
|
+
* once it classifies the native button as icon-having and label-less, so
|
|
40
|
+
* its direct children are icon content unless a responsive composition
|
|
41
|
+
* exposes an authored `[data-rc-menu-label]`; size every other direct
|
|
42
|
+
* child as an icon. The explicit marker rule above still matters for an
|
|
43
|
+
* icon nested one level deeper than a direct child.
|
|
44
|
+
*/
|
|
45
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
46
|
+
rc-button[icon-only]
|
|
47
|
+
> button
|
|
48
|
+
> :not([data-rc-menu-label]) {
|
|
49
|
+
font-size: var(--rc-icon-button-icon-font-size, 1.5rem);
|
|
50
|
+
line-height: var(--rc-icon-button-icon-font-size, 1.5rem) !important;
|
|
51
|
+
}
|
|
19
52
|
}
|
package/components/list-item.css
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
@layer rc-theme-material.components {
|
|
2
2
|
:where(.rc-theme-material, :host(.rc-theme-material)) {
|
|
3
|
+
/* Compatibility tokens retained for rc-listbox and embedded selectors. */
|
|
3
4
|
--rc-list-item-gap: 1rem;
|
|
4
5
|
--rc-list-item-min-block-size: 3rem;
|
|
5
6
|
--rc-list-item-padding-block: 0;
|
|
6
7
|
--rc-list-item-padding-inline: 1rem;
|
|
7
|
-
--rc-list-item-divider: 0;
|
|
8
8
|
--rc-list-item-bg: transparent;
|
|
9
|
-
--rc-list-item-color: var(--md-sys-color-on-surface, CanvasText);
|
|
10
9
|
--rc-list-item-supporting-color: var(--md-sys-color-on-surface-variant, CanvasText);
|
|
11
10
|
--rc-list-item-hover-bg: color-mix(
|
|
12
11
|
in srgb,
|
|
@@ -25,53 +24,102 @@
|
|
|
25
24
|
--rc-list-item-disabled-opacity: var(--md-sys-state-disabled-state-layer-opacity, 0.38);
|
|
26
25
|
}
|
|
27
26
|
|
|
28
|
-
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
29
|
-
list-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-list {
|
|
28
|
+
--rc-list-padding-inline: 1rem;
|
|
29
|
+
--rc-list-leading-gap: 1rem;
|
|
30
|
+
--rc-list-trailing-gap: 1rem;
|
|
31
|
+
--rc-list-row-gap: 0;
|
|
32
|
+
--rc-list-item-min-block-size: 3.5rem;
|
|
33
|
+
--rc-list-item-padding-block: 0.5rem;
|
|
34
|
+
--rc-list-item-color: var(--md-sys-color-on-surface, CanvasText);
|
|
35
|
+
--rc-list-item-background: transparent;
|
|
36
|
+
--rc-list-item-selected-color: var(--md-sys-color-on-secondary-container, HighlightText);
|
|
37
|
+
--rc-list-item-selected-background: var(--md-sys-color-secondary-container, Highlight);
|
|
38
|
+
--rc-list-item-divider: 1px solid var(--md-sys-color-outline-variant, GrayText);
|
|
39
|
+
--rc-list-item-state-layer-color: var(--md-sys-color-on-surface, CanvasText);
|
|
40
|
+
--rc-list-item-hover-state-layer-opacity: var(--md-sys-state-hover-state-layer-opacity, 0.08);
|
|
41
|
+
--rc-list-item-focus-state-layer-opacity: var(--md-sys-state-focus-state-layer-opacity, 0.1);
|
|
42
|
+
--rc-list-item-pressed-state-layer-opacity: var(
|
|
43
|
+
--md-sys-state-pressed-state-layer-opacity,
|
|
44
|
+
0.12
|
|
45
|
+
);
|
|
46
|
+
--rc-list-item-disabled-opacity: var(--md-sys-state-disabled-state-layer-opacity, 0.38);
|
|
47
|
+
--rc-list-item-transition-duration: var(--md-sys-motion-duration-short3, 150ms);
|
|
48
|
+
--rc-list-item-transition-easing: var(--md-sys-motion-easing-standard, ease);
|
|
32
49
|
}
|
|
33
50
|
|
|
34
|
-
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
border-
|
|
41
|
-
background: var(--rc-list-item-bg);
|
|
42
|
-
color: var(--rc-list-item-color);
|
|
43
|
-
box-sizing: border-box;
|
|
51
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-list[variant='segmented'] {
|
|
52
|
+
--rc-list-row-gap: 0.125rem;
|
|
53
|
+
--rc-list-item-min-block-size: 3.5rem;
|
|
54
|
+
--rc-list-item-padding-block: 0.625rem;
|
|
55
|
+
--rc-list-item-background: var(--md-sys-color-surface-container-low, Canvas);
|
|
56
|
+
--rc-list-item-divider: 0;
|
|
57
|
+
--rc-list-item-border-radius: var(--md-sys-shape-corner-extra-small, 0.25rem);
|
|
44
58
|
}
|
|
45
59
|
|
|
46
|
-
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
60
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
61
|
+
rc-list[variant='segmented']
|
|
62
|
+
> rc-list-item[data-rc-list-position='only'] {
|
|
63
|
+
--rc-list-item-border-radius: var(--md-sys-shape-corner-extra-large, 1.75rem);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
67
|
+
rc-list[variant='segmented']
|
|
68
|
+
> rc-list-item[data-rc-list-position='first'] {
|
|
69
|
+
--rc-list-item-border-radius: var(--md-sys-shape-corner-extra-large, 1.75rem)
|
|
70
|
+
var(--md-sys-shape-corner-extra-large, 1.75rem)
|
|
71
|
+
var(--md-sys-shape-corner-extra-small, 0.25rem)
|
|
72
|
+
var(--md-sys-shape-corner-extra-small, 0.25rem);
|
|
52
73
|
}
|
|
53
74
|
|
|
54
|
-
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
75
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
76
|
+
rc-list[variant='segmented']
|
|
77
|
+
> rc-list-item[data-rc-list-position='last'] {
|
|
78
|
+
--rc-list-item-border-radius: var(--md-sys-shape-corner-extra-small, 0.25rem)
|
|
79
|
+
var(--md-sys-shape-corner-extra-small, 0.25rem)
|
|
80
|
+
var(--md-sys-shape-corner-extra-large, 1.75rem)
|
|
81
|
+
var(--md-sys-shape-corner-extra-large, 1.75rem);
|
|
59
82
|
}
|
|
60
83
|
|
|
61
|
-
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
62
|
-
color: var(--rc-list-item-color);
|
|
84
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-list-item::part(content) {
|
|
63
85
|
font-family: var(--md-sys-typescale-body-large-font, inherit);
|
|
64
86
|
font-size: var(--md-sys-typescale-body-large-size, 1rem);
|
|
87
|
+
font-weight: var(--md-sys-typescale-body-large-weight, 400);
|
|
65
88
|
line-height: var(--md-sys-typescale-body-large-line-height, 1.5rem);
|
|
66
89
|
}
|
|
67
90
|
|
|
68
|
-
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
69
|
-
|
|
91
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
92
|
+
rc-list-item
|
|
93
|
+
> :where([data-rc-list-supporting], small) {
|
|
94
|
+
display: block;
|
|
95
|
+
color: var(--md-sys-color-on-surface-variant, CanvasText);
|
|
70
96
|
font-family: var(--md-sys-typescale-body-medium-font, inherit);
|
|
71
97
|
font-size: var(--md-sys-typescale-body-medium-size, 0.875rem);
|
|
98
|
+
font-weight: var(--md-sys-typescale-body-medium-weight, 400);
|
|
72
99
|
line-height: var(--md-sys-typescale-body-medium-line-height, 1.25rem);
|
|
73
100
|
}
|
|
74
101
|
|
|
102
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
103
|
+
rc-list-item
|
|
104
|
+
> [slot='leading'][data-rc-list-leading] {
|
|
105
|
+
display: inline-flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
justify-content: center;
|
|
108
|
+
inline-size: 1.5rem;
|
|
109
|
+
block-size: 1.5rem;
|
|
110
|
+
font-size: 1.5rem;
|
|
111
|
+
line-height: 1.5rem;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
115
|
+
rc-list-item
|
|
116
|
+
> :is(input[type='checkbox'], input[type='radio'])[slot='leading'] {
|
|
117
|
+
inline-size: 1.125rem;
|
|
118
|
+
block-size: 1.125rem;
|
|
119
|
+
margin: 0;
|
|
120
|
+
accent-color: var(--md-sys-color-primary, Highlight);
|
|
121
|
+
}
|
|
122
|
+
|
|
75
123
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-listbox,
|
|
76
124
|
:where(.rc-theme-material, :host(.rc-theme-material)) [part~='listbox'] {
|
|
77
125
|
--rc-listbox-option-gap: var(--rc-list-item-gap);
|
|
@@ -19,4 +19,105 @@
|
|
|
19
19
|
--rc-menu-button-indicator-size: 1.5rem;
|
|
20
20
|
--rc-menu-button-indicator-color: var(--md-sys-color-on-surface-variant, CanvasText);
|
|
21
21
|
}
|
|
22
|
+
|
|
23
|
+
/*
|
|
24
|
+
* MD3 "Small" icon button sizing (40dp square trigger / 24dp icon) for an
|
|
25
|
+
* icon-only rc-menu-button trigger — e.g. an app bar's overflow button.
|
|
26
|
+
* rc-menu-button's own touch-target affordance (min-inline/block-size
|
|
27
|
+
* 3rem on the trigger wrapper, plus the light-DOM hit-slop) makes up the
|
|
28
|
+
* difference to the 48dp minimum tap target on its own.
|
|
29
|
+
* https://m3.material.io/components/icon-buttons/specs
|
|
30
|
+
*/
|
|
31
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-menu-button[icon-only] {
|
|
32
|
+
--rc-menu-button-trigger-block-size: 2.5rem;
|
|
33
|
+
--rc-menu-button-trigger-padding-block: 0;
|
|
34
|
+
--rc-menu-button-trigger-padding-inline: 0;
|
|
35
|
+
--rc-menu-button-trigger-gap: 0;
|
|
36
|
+
--rc-menu-button-icon-size: 2.5rem;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* Adaptive overflow keeps the authored menu label in the trigger, so the
|
|
40
|
+
shared label marker is the one direct child that is not icon content. */
|
|
41
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
42
|
+
rc-menu-button[icon-only]
|
|
43
|
+
> [slot='trigger']
|
|
44
|
+
> :not([data-rc-menu-label]) {
|
|
45
|
+
font-size: var(--rc-icon-button-icon-font-size, 1.5rem);
|
|
46
|
+
line-height: var(--rc-icon-button-icon-font-size, 1.5rem) !important;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/*
|
|
50
|
+
* Narrow width: trims the trigger's inline size (32dp, the MD3 "Small"
|
|
51
|
+
* narrow-width spec value) without changing its height. Suits a dense
|
|
52
|
+
* context that already has an unambiguous, self-labeling icon and no
|
|
53
|
+
* neighbors it needs to align widths with — an app bar's trailing
|
|
54
|
+
* overflow trigger is the canonical case, so this also defaults the
|
|
55
|
+
* trailing-edge overlap token: (3rem default touch target - 2rem icon
|
|
56
|
+
* size) / 2, giving back exactly what the touch target would otherwise
|
|
57
|
+
* reserve past the visible trigger. Trailing-edge only, matching the
|
|
58
|
+
* "trailing overflow trigger" framing above -- see rc-button's own
|
|
59
|
+
* narrow-variant comment for why only one side defaults.
|
|
60
|
+
*/
|
|
61
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
62
|
+
rc-menu-button.rc-menu-button--narrow[icon-only] {
|
|
63
|
+
--rc-menu-button-icon-size: 2rem;
|
|
64
|
+
--rc-menu-button-touch-target-overlap-inline-end: 0.5rem;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/*
|
|
68
|
+
* A submenu trigger (a cascading menu item that opens a nested rc-menu)
|
|
69
|
+
* is still an rc-menu-button underneath, but MD3 treats it as a menu row
|
|
70
|
+
* with a trailing disclosure chevron — not as its own standalone pill
|
|
71
|
+
* control. The base rule above (and rc-menu-button's own defaults) style
|
|
72
|
+
* it as the latter: a primary-colored, pill-shaped, independently-padded
|
|
73
|
+
* trigger, layered on top of whatever geometry rc-menu's own item CSS
|
|
74
|
+
* (menu.css / rc-base) tries to apply to the same element by virtue of
|
|
75
|
+
* its role="menuitem" — hence the mismatched shape and the icon sitting
|
|
76
|
+
* at a different inset than its sibling rows.
|
|
77
|
+
*
|
|
78
|
+
* The consumer marks this case the same way rc-menu itself expects a
|
|
79
|
+
* cascading item to be marked (role="menuitem" — see menu.css and
|
|
80
|
+
* rc-menu's own light-DOM CSS), so key every geometry/color token here
|
|
81
|
+
* off rc-menu's own item, hover, and active tokens (--rc-menu-item-...,
|
|
82
|
+
* --rc-menu-hover-..., --rc-menu-active-...) instead of hand-matching
|
|
83
|
+
* values that could drift out of sync with a sibling plain-button item
|
|
84
|
+
* later.
|
|
85
|
+
* https://m3.material.io/components/menus/specs
|
|
86
|
+
*/
|
|
87
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-menu-button[role='menuitem'] {
|
|
88
|
+
font-family: var(--md-sys-typescale-body-large-font, inherit);
|
|
89
|
+
font-size: var(--md-sys-typescale-body-large-size, 1rem);
|
|
90
|
+
font-weight: 400;
|
|
91
|
+
|
|
92
|
+
--rc-menu-button-trigger-block-size: var(--rc-menu-item-min-block-size, 3rem);
|
|
93
|
+
--rc-menu-button-trigger-padding-block: var(--rc-menu-item-padding-block, 0);
|
|
94
|
+
--rc-menu-button-trigger-padding-inline: var(--rc-menu-item-padding-inline, 0.75rem);
|
|
95
|
+
--rc-menu-button-trigger-gap: var(--rc-menu-item-gap, 0.75rem);
|
|
96
|
+
--rc-menu-button-trigger-radius: 0;
|
|
97
|
+
--rc-menu-button-trigger-border: 0;
|
|
98
|
+
--rc-menu-button-trigger-background: transparent;
|
|
99
|
+
--rc-menu-button-trigger-color: inherit;
|
|
100
|
+
--rc-menu-button-trigger-hover-background: var(--rc-menu-hover-bg);
|
|
101
|
+
--rc-menu-button-trigger-hover-color: var(--rc-menu-hover-color, inherit);
|
|
102
|
+
--rc-menu-button-trigger-open-background: var(--rc-menu-active-bg);
|
|
103
|
+
--rc-menu-button-trigger-open-color: var(--rc-menu-active-color, inherit);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/*
|
|
107
|
+
* rc-menu's own light-DOM CSS (rc-base, an even-higher-priority layer
|
|
108
|
+
* than this one — it's registered at custom-element-connect time,
|
|
109
|
+
* after every static stylesheet) matches *any* role="menuitem" element
|
|
110
|
+
* for its generic item padding, which includes this host itself, not
|
|
111
|
+
* just plain-button items. Left alone, that stacks on top of the
|
|
112
|
+
* trigger-inline padding bridged above: the host absorbs one
|
|
113
|
+
* --rc-menu-item-padding-inline, then the trigger button absorbs
|
|
114
|
+
* another, doubling the icon's inset versus a sibling row. The host
|
|
115
|
+
* itself isn't a visible surface — all padding belongs on the one
|
|
116
|
+
* real, visible trigger button — so it needs to contribute zero here,
|
|
117
|
+
* which (since rc-base doesn't mark its own padding !important) is
|
|
118
|
+
* only reachable with !important of our own.
|
|
119
|
+
*/
|
|
120
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-menu-button[role='menuitem'] {
|
|
121
|
+
padding-inline: 0 !important;
|
|
122
|
+
}
|
|
22
123
|
}
|
package/components/menu.css
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
);
|
|
35
35
|
--rc-menu-active-color: var(--md-sys-color-on-surface, CanvasText);
|
|
36
36
|
|
|
37
|
-
/* Check/radio indicator — M3
|
|
37
|
+
/* Check/radio indicator — M3 trailing indicator column is 24dp wide */
|
|
38
38
|
--rc-menu-check-size: 1.5rem;
|
|
39
39
|
--rc-menu-check-color: var(--md-sys-color-primary, Highlight);
|
|
40
40
|
|
|
@@ -58,6 +58,35 @@
|
|
|
58
58
|
outline: none;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
/*
|
|
62
|
+
* M3 baseline menu items are rectangular full-width rows (unlike a
|
|
63
|
+
* standalone rc-button, which is a pill) — rc-menu's own structural CSS
|
|
64
|
+
* intentionally leaves shape undecided (it's a themed concern), so claim
|
|
65
|
+
* it explicitly here rather than leaving items to whatever shape a
|
|
66
|
+
* consumer's own incidental button styling might otherwise supply.
|
|
67
|
+
*/
|
|
68
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
69
|
+
rc-menu
|
|
70
|
+
:is([role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio']) {
|
|
71
|
+
border-radius: 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/*
|
|
75
|
+
* Sizes an item's own leading icon to the M3 menu leading-icon size.
|
|
76
|
+
* Unlike an icon-only rc-button, a menu item routinely combines an icon
|
|
77
|
+
* *and* a label (they aren't mutually exclusive), so "first child" isn't
|
|
78
|
+
* a safe stand-in for "the icon" here the way it is there — this only
|
|
79
|
+
* sizes content the consumer has actually marked as an icon.
|
|
80
|
+
*/
|
|
81
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
82
|
+
rc-menu
|
|
83
|
+
:is([role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio'])
|
|
84
|
+
:is([data-rc-icon], [data-rc-menu-leading], [data-rc-menu-icon]) {
|
|
85
|
+
flex: none;
|
|
86
|
+
font-size: 1.5rem;
|
|
87
|
+
line-height: 1.5rem;
|
|
88
|
+
}
|
|
89
|
+
|
|
61
90
|
/* Current item (navigation active / selected radio row) gets secondary-container */
|
|
62
91
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-menu [aria-current='true'] {
|
|
63
92
|
background: var(--md-sys-color-secondary-container, Highlight);
|
package/components/modes.css
CHANGED
|
@@ -9,22 +9,24 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
@media (forced-colors: active) {
|
|
12
|
-
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
13
|
+
:is(
|
|
14
|
+
rc-select,
|
|
15
|
+
rc-combobox,
|
|
16
|
+
rc-search-bar,
|
|
17
|
+
rc-textarea,
|
|
18
|
+
rc-markdown-editor,
|
|
19
|
+
rc-menu,
|
|
20
|
+
rc-menubar,
|
|
21
|
+
rc-toolbar,
|
|
22
|
+
rc-dialog > dialog
|
|
23
|
+
) {
|
|
23
24
|
forced-color-adjust: auto;
|
|
24
25
|
box-shadow: none;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
28
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
29
|
+
:is(button, [role='button'], [role^='menuitem']):focus-visible {
|
|
28
30
|
outline: 2px solid Highlight;
|
|
29
31
|
}
|
|
30
32
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
@layer rc-theme-material.components {
|
|
2
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-progress::part(value-display) {
|
|
3
|
+
color: var(--md-sys-color-on-surface-variant, GrayText);
|
|
4
|
+
font-size: var(--md-sys-typescale-label-small-size, 0.75rem);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-progress[disabled] {
|
|
8
|
+
opacity: var(--md-sys-state-disabled-state-layer-opacity, 0.38);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -3,15 +3,19 @@
|
|
|
3
3
|
border-width: 0;
|
|
4
4
|
border-radius: var(--md-sys-shape-corner-full, 999px);
|
|
5
5
|
box-shadow: 0 0 0 0 transparent;
|
|
6
|
-
transition:
|
|
6
|
+
transition:
|
|
7
|
+
box-shadow 150ms ease,
|
|
8
|
+
scale 150ms ease;
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-range-slider::part(thumb):hover {
|
|
10
|
-
box-shadow: 0 0 0 0.5rem
|
|
12
|
+
box-shadow: 0 0 0 0.5rem
|
|
13
|
+
color-mix(in srgb, var(--md-sys-color-primary, Highlight) 8%, transparent);
|
|
11
14
|
}
|
|
12
15
|
|
|
13
16
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-range-slider::part(thumb):active {
|
|
14
|
-
box-shadow: 0 0 0 0.625rem
|
|
17
|
+
box-shadow: 0 0 0 0.625rem
|
|
18
|
+
color-mix(in srgb, var(--md-sys-color-primary, Highlight) 12%, transparent);
|
|
15
19
|
scale: 0.9;
|
|
16
20
|
}
|
|
17
21
|
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
--rc-segmented-button-selected-color: var(--md-sys-color-on-secondary-container, HighlightText);
|
|
38
38
|
--rc-segmented-button-segment-min-block-size: 2.5rem;
|
|
39
39
|
--rc-segmented-button-segment-padding-inline: 1rem;
|
|
40
|
+
--rc-segmented-button-segment-gap: 0.5em;
|
|
40
41
|
--rc-segmented-button-focus-ring: var(--rc-focus-ring);
|
|
41
42
|
--rc-segmented-button-focus-ring-offset: -2px;
|
|
42
43
|
--rc-segmented-button-disabled-opacity: var(--rc-disabled-opacity);
|
package/components/select.css
CHANGED
|
@@ -31,6 +31,13 @@
|
|
|
31
31
|
color: var(--md-sys-color-on-surface-variant, ButtonText);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-select::part(chips) {
|
|
35
|
+
--rc-chip-block-size: 2rem;
|
|
36
|
+
--rc-chip-touch-target-block-size: 3rem;
|
|
37
|
+
--rc-chip-radius: var(--md-sys-shape-corner-small, 0.5rem);
|
|
38
|
+
--rc-chip-remove-target-size: 1.5rem;
|
|
39
|
+
}
|
|
40
|
+
|
|
34
41
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-select::part(chip):hover {
|
|
35
42
|
background: color-mix(
|
|
36
43
|
in srgb,
|
package/components/textarea.css
CHANGED
|
@@ -7,14 +7,20 @@
|
|
|
7
7
|
--rc-textarea-padding: 1rem;
|
|
8
8
|
--rc-textarea-focus-outline: 2px solid var(--md-sys-color-primary, Highlight);
|
|
9
9
|
--rc-textarea-caret-color: var(--md-sys-color-primary, FieldText);
|
|
10
|
-
--rc-textarea-active-line-bg: color-mix(
|
|
10
|
+
--rc-textarea-active-line-bg: color-mix(
|
|
11
|
+
in srgb,
|
|
12
|
+
var(--md-sys-color-primary, Highlight) 8%,
|
|
13
|
+
transparent
|
|
14
|
+
);
|
|
11
15
|
--rc-textarea-gutter-bg: var(--md-sys-color-surface-container, Canvas);
|
|
12
16
|
--rc-textarea-gutter-color: var(--md-sys-color-on-surface-variant, GrayText);
|
|
13
17
|
--rc-textarea-gutter-border: 1px solid var(--md-sys-color-outline-variant, ButtonBorder);
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-textarea::part(root) {
|
|
17
|
-
transition:
|
|
21
|
+
transition:
|
|
22
|
+
border-color 150ms ease,
|
|
23
|
+
box-shadow 150ms ease;
|
|
18
24
|
}
|
|
19
25
|
|
|
20
26
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-textarea::part(root):hover {
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
--rc-virtual-canvas-scrollbar-size: 0.75rem;
|
|
5
5
|
--rc-virtual-canvas-scrollbar-thumb-background: var(--md-sys-color-outline, ButtonFace);
|
|
6
6
|
--rc-virtual-canvas-scrollbar-track-background: var(--md-sys-color-surface-container, Canvas);
|
|
7
|
-
--rc-virtual-canvas-scrollbar-button-background: var(
|
|
7
|
+
--rc-virtual-canvas-scrollbar-button-background: var(
|
|
8
|
+
--md-sys-color-surface-container-high,
|
|
9
|
+
ButtonFace
|
|
10
|
+
);
|
|
8
11
|
border-radius: var(--md-sys-shape-corner-medium, 0.75rem);
|
|
9
12
|
background: var(--md-sys-color-surface-container-low, Canvas);
|
|
10
13
|
box-shadow: inset 0 0 0 1px var(--md-sys-color-outline-variant, ButtonBorder);
|
package/components.css
CHANGED
|
@@ -11,19 +11,24 @@
|
|
|
11
11
|
@import './components/transfer-list.css';
|
|
12
12
|
@import './components/button.css';
|
|
13
13
|
@import './components/card.css';
|
|
14
|
+
@import './components/scroller.css';
|
|
15
|
+
@import './components/carousel.css';
|
|
14
16
|
@import './components/chip.css';
|
|
17
|
+
@import './components/chip-group.css';
|
|
15
18
|
@import './components/list-item.css';
|
|
16
19
|
@import './components/fab.css';
|
|
17
20
|
@import './components/fab-menu.css';
|
|
18
21
|
@import './components/app-bar.css';
|
|
19
22
|
@import './components/menu.css';
|
|
20
23
|
@import './components/menu-button.css';
|
|
24
|
+
@import './components/adaptive-menu.css';
|
|
21
25
|
@import './components/menubar.css';
|
|
22
26
|
@import './components/navigation-bar.css';
|
|
23
27
|
@import './components/navigation-rail.css';
|
|
24
28
|
@import './components/toolbar.css';
|
|
25
29
|
@import './components/segmented-button.css';
|
|
26
30
|
@import './components/slider.css';
|
|
31
|
+
@import './components/progress.css';
|
|
27
32
|
@import './components/snackbar.css';
|
|
28
33
|
@import './components/range-slider.css';
|
|
29
34
|
@import './components/splitter.css';
|