@rcarls/rc-theme-material 0.5.0 → 0.7.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 +600 -0
- package/DESIGN.md +1399 -0
- package/README.md +138 -5
- package/bridge.css +150 -55
- package/components/accordion.css +43 -157
- package/components/adaptive-menu.css +123 -0
- package/components/app-bar.css +49 -7
- package/components/bottom-sheet.css +10 -7
- package/components/button.css +215 -2
- package/components/card.css +2 -0
- package/components/carousel.css +23 -0
- package/components/chip-group.css +15 -0
- package/components/chip.css +12 -1
- package/components/combobox.css +68 -14
- package/components/dialog.css +77 -15
- package/components/disclosure.css +128 -84
- package/components/field.css +566 -0
- package/components/icons.css +48 -6
- package/components/list-item.css +142 -32
- package/components/listbox.css +5 -4
- package/components/markdown-editor.css +62 -35
- package/components/menu-button.css +105 -1
- package/components/menu.css +32 -16
- package/components/menubar.css +4 -1
- package/components/modes.css +36 -17
- package/components/navigation-bar.css +3 -5
- package/components/navigation-rail.css +5 -7
- package/components/popover.css +50 -0
- package/components/progress.css +15 -0
- package/components/range-slider.css +8 -3
- package/components/scroller.css +7 -0
- package/components/search-bar.css +12 -2
- package/components/segmented-button.css +2 -28
- package/components/select.css +106 -14
- package/components/splitter.css +4 -1
- package/components/switch.css +9 -1
- package/components/textarea.css +13 -3
- package/components/toolbar.css +2 -1
- package/components/tooltip.css +12 -0
- package/components/transfer-list.css +5 -1
- package/components/virtual-canvas.css +4 -1
- package/components/virtual-scroller.css +7 -0
- package/components.css +11 -1
- package/constraints/material.json +99 -0
- package/css-components/button.css +66 -0
- package/css-components/card.css +14 -0
- package/css-components/chip-group.css +9 -0
- package/css-components/chip.css +80 -0
- package/css-components/disclosure.css +25 -0
- package/css-components/list.css +34 -0
- package/css-components/select.css +20 -0
- package/css-components/textarea.css +22 -0
- package/css-components.css +31 -0
- package/defaults.css +329 -14
- package/native.css +258 -0
- package/package.json +21 -2
- package/state-layer.css +5 -1
|
@@ -1,123 +1,167 @@
|
|
|
1
1
|
@layer rc-theme-material.components {
|
|
2
|
+
/*
|
|
3
|
+
* Maps Material tokens onto the public rc-disclosure properties. The panel,
|
|
4
|
+
* summary, and content boxes are drawn by the component's own light-DOM base
|
|
5
|
+
* layer; what is left here is the token mapping plus decoration that genuinely
|
|
6
|
+
* depends on a selector.
|
|
7
|
+
*
|
|
8
|
+
* One mapping covers both `rc-disclosure` and `rc-accordion`, since a panel
|
|
9
|
+
* reads the same properties either way.
|
|
10
|
+
*/
|
|
2
11
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-disclosure {
|
|
12
|
+
/*
|
|
13
|
+
* Layout stays in theme CSS so a disclosure is laid out before the element
|
|
14
|
+
* upgrades; only the property-driven drawing lives in the component's base
|
|
15
|
+
* layer, which needs JS to install.
|
|
16
|
+
*/
|
|
3
17
|
display: block;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) :is(rc-disclosure, rc-accordion) {
|
|
4
21
|
--rc-theme-material-disclosure-easing: cubic-bezier(
|
|
5
22
|
var(--md-sys-motion-easing-standard-x0, 0.2),
|
|
6
23
|
var(--md-sys-motion-easing-standard-y0, 0),
|
|
7
24
|
var(--md-sys-motion-easing-standard-x1, 0),
|
|
8
25
|
var(--md-sys-motion-easing-standard-y1, 1)
|
|
9
26
|
);
|
|
27
|
+
|
|
28
|
+
--rc-disclosure-border: 1px solid var(--md-sys-color-outline-variant, ButtonBorder);
|
|
29
|
+
--rc-disclosure-radius: var(--md-sys-shape-corner-large, 1rem);
|
|
30
|
+
--rc-disclosure-background: var(--md-sys-color-surface-container-low, Canvas);
|
|
31
|
+
--rc-disclosure-color: var(--md-sys-color-on-surface, CanvasText);
|
|
32
|
+
--rc-disclosure-open-background: var(--md-sys-color-surface-container, Canvas);
|
|
33
|
+
--rc-disclosure-open-shadow: var(
|
|
34
|
+
--rc-shadow-level1,
|
|
35
|
+
0 1px 2px 0 rgb(0 0 0 / 0.3),
|
|
36
|
+
0 1px 3px 1px rgb(0 0 0 / 0.15)
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
--rc-disclosure-summary-min-block-size: 3.5rem;
|
|
40
|
+
--rc-disclosure-summary-padding-block: 0.75rem;
|
|
41
|
+
--rc-disclosure-summary-padding-inline: 1rem;
|
|
42
|
+
--rc-disclosure-summary-color: var(--md-sys-color-on-surface, CanvasText);
|
|
43
|
+
--rc-disclosure-summary-font: var(--md-sys-typescale-title-small-weight, 500)
|
|
44
|
+
var(--md-sys-typescale-title-small-size, 0.875rem) /
|
|
45
|
+
var(--md-sys-typescale-title-small-line-height, 1.25rem)
|
|
46
|
+
var(--md-sys-typescale-title-small-font, sans-serif);
|
|
47
|
+
--rc-disclosure-summary-marker-color: var(--md-sys-color-on-surface-variant, GrayText);
|
|
48
|
+
--rc-disclosure-summary-hover-background: color-mix(
|
|
49
|
+
in srgb,
|
|
50
|
+
var(--md-sys-color-on-surface, CanvasText)
|
|
51
|
+
calc(var(--md-sys-state-hover-state-layer-opacity, 0.08) * 100%),
|
|
52
|
+
transparent
|
|
53
|
+
);
|
|
54
|
+
--rc-disclosure-focus-ring-offset: -2px;
|
|
55
|
+
|
|
56
|
+
--rc-disclosure-content-padding-block: 0.5rem 1rem;
|
|
57
|
+
--rc-disclosure-content-padding-inline: 1rem;
|
|
58
|
+
--rc-disclosure-content-color: var(--md-sys-color-on-surface-variant, CanvasText);
|
|
59
|
+
--rc-disclosure-content-font: var(--md-sys-typescale-body-medium-size, 0.875rem) /
|
|
60
|
+
var(--md-sys-typescale-body-medium-line-height, 1.25rem)
|
|
61
|
+
var(--md-sys-typescale-body-medium-font, sans-serif);
|
|
62
|
+
|
|
63
|
+
--rc-disclosure-duration: var(--rc-motion-effects-duration-slow, 300ms);
|
|
64
|
+
--rc-disclosure-easing: var(--rc-theme-material-disclosure-easing);
|
|
10
65
|
}
|
|
11
66
|
|
|
12
|
-
|
|
67
|
+
/*
|
|
68
|
+
* Clipping keeps the summary's hover layer and the animating content inside
|
|
69
|
+
* the corner radius, and the panel cross-fades its own surface as it opens.
|
|
70
|
+
*/
|
|
71
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) :is(rc-disclosure, rc-accordion) > details {
|
|
13
72
|
overflow: clip;
|
|
14
|
-
border: 1px solid var(--md-sys-color-outline-variant, ButtonBorder);
|
|
15
|
-
border-radius: var(--md-sys-shape-corner-large, 1rem);
|
|
16
|
-
background: var(--md-sys-color-surface-container-low, Canvas);
|
|
17
|
-
color: var(--md-sys-color-on-surface, CanvasText);
|
|
18
73
|
transition:
|
|
19
|
-
background-color var(--
|
|
74
|
+
background-color var(--rc-motion-effects-duration-default, 200ms)
|
|
20
75
|
var(--rc-theme-material-disclosure-easing),
|
|
21
|
-
border-color var(--
|
|
76
|
+
border-color var(--rc-motion-effects-duration-default, 200ms)
|
|
22
77
|
var(--rc-theme-material-disclosure-easing),
|
|
23
|
-
box-shadow var(--
|
|
78
|
+
box-shadow var(--rc-motion-effects-duration-default, 200ms)
|
|
79
|
+
var(--rc-theme-material-disclosure-easing);
|
|
24
80
|
}
|
|
25
81
|
|
|
26
|
-
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
0 1px 3px 1px rgb(0 0 0 / 0.15)
|
|
32
|
-
);
|
|
33
|
-
}
|
|
82
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
83
|
+
:is(rc-disclosure, rc-accordion)
|
|
84
|
+
> details
|
|
85
|
+
> summary {
|
|
86
|
+
-webkit-tap-highlight-color: transparent;
|
|
34
87
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
88
|
+
/*
|
|
89
|
+
* Material replaces the native marker with a trailing expand chevron, the
|
|
90
|
+
* Android expandable-list-item affordance, so it owns both halves of that
|
|
91
|
+
* swap: hiding `::marker` and drawing the replacement. That is what makes
|
|
92
|
+
* dropping the `list-item` box safe. Flex centers the authored summary
|
|
93
|
+
* content without assigning one of its children to the chevron column.
|
|
94
|
+
*/
|
|
95
|
+
display: flex;
|
|
38
96
|
align-items: center;
|
|
39
|
-
|
|
40
|
-
min-block-size: 3.5rem;
|
|
41
|
-
padding-block: 0.75rem;
|
|
42
|
-
padding-inline: 1rem;
|
|
43
|
-
border-radius: calc(var(--md-sys-shape-corner-large, 1rem) - 1px);
|
|
44
|
-
color: var(--md-sys-color-on-surface, CanvasText);
|
|
45
|
-
cursor: pointer;
|
|
46
|
-
font-family: var(--md-sys-typescale-title-small-font, inherit);
|
|
47
|
-
font-size: var(--md-sys-typescale-title-small-size, 0.875rem);
|
|
48
|
-
font-weight: var(--md-sys-typescale-title-small-weight, 500);
|
|
49
|
-
line-height: var(--md-sys-typescale-title-small-line-height, 1.25rem);
|
|
50
|
-
transition: background-color var(--md-sys-motion-duration-100, 100ms)
|
|
51
|
-
var(--rc-theme-material-disclosure-easing);
|
|
52
|
-
}
|
|
97
|
+
gap: 1rem;
|
|
53
98
|
|
|
54
|
-
|
|
55
|
-
|
|
99
|
+
/* The accordion applies matching logical outer corners to this hover surface. */
|
|
100
|
+
border-radius: var(--rc-disclosure-radius, 0);
|
|
101
|
+
transition: background-color var(--rc-motion-effects-duration-fast, 150ms)
|
|
102
|
+
var(--rc-theme-material-disclosure-easing);
|
|
56
103
|
}
|
|
57
104
|
|
|
58
|
-
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
calc(var(--md-sys-state-hover-state-layer-opacity, 0.08) * 100%),
|
|
64
|
-
transparent
|
|
65
|
-
);
|
|
105
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
106
|
+
:is(rc-disclosure, rc-accordion)
|
|
107
|
+
> details
|
|
108
|
+
> summary::marker {
|
|
109
|
+
content: '';
|
|
66
110
|
}
|
|
67
111
|
|
|
68
112
|
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
69
|
-
rc-disclosure
|
|
113
|
+
:is(rc-disclosure, rc-accordion)
|
|
70
114
|
> details
|
|
71
|
-
> summary
|
|
72
|
-
|
|
73
|
-
outline-offset: -2px;
|
|
115
|
+
> summary::-webkit-details-marker {
|
|
116
|
+
display: none;
|
|
74
117
|
}
|
|
75
118
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
119
|
+
/*
|
|
120
|
+
* A border-drawn chevron rather than a masked icon, so forced-colors mode
|
|
121
|
+
* repaints it as a system color without a separate override. Keep its own
|
|
122
|
+
* axes horizontal and left-to-right so inherited RTL or vertical writing
|
|
123
|
+
* does not turn the down/up affordance sideways.
|
|
124
|
+
*/
|
|
125
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
126
|
+
:is(rc-disclosure, rc-accordion)
|
|
127
|
+
> details
|
|
128
|
+
> summary::after {
|
|
129
|
+
content: '';
|
|
130
|
+
direction: ltr;
|
|
131
|
+
writing-mode: horizontal-tb;
|
|
132
|
+
flex: none;
|
|
133
|
+
margin-inline-start: auto;
|
|
134
|
+
inline-size: 0.4375rem;
|
|
135
|
+
block-size: 0.4375rem;
|
|
136
|
+
border-block-start: 2px solid currentColor;
|
|
137
|
+
border-inline-end: 2px solid currentColor;
|
|
138
|
+
color: var(--rc-disclosure-summary-marker-color, currentColor);
|
|
139
|
+
translate: 0 -0.125rem;
|
|
140
|
+
rotate: 135deg;
|
|
87
141
|
transition:
|
|
88
|
-
|
|
142
|
+
rotate var(--rc-motion-spatial-duration-fast, 300ms)
|
|
89
143
|
var(--rc-theme-material-disclosure-easing),
|
|
90
|
-
|
|
91
|
-
padding-block var(--md-sys-motion-duration-200, 200ms)
|
|
144
|
+
translate var(--rc-motion-spatial-duration-fast, 300ms)
|
|
92
145
|
var(--rc-theme-material-disclosure-easing);
|
|
93
146
|
}
|
|
94
147
|
|
|
95
148
|
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
96
|
-
rc-disclosure
|
|
149
|
+
:is(rc-disclosure, rc-accordion)
|
|
97
150
|
> details[open]
|
|
98
|
-
>
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
opacity: 1;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
@supports (transition-behavior: allow-discrete) {
|
|
105
|
-
:where(.rc-theme-material, :host(.rc-theme-material)) rc-disclosure > details > :not(summary) {
|
|
106
|
-
transition:
|
|
107
|
-
content-visibility var(--md-sys-motion-duration-300, 300ms) allow-discrete,
|
|
108
|
-
max-block-size var(--md-sys-motion-duration-300, 300ms)
|
|
109
|
-
var(--rc-theme-material-disclosure-easing),
|
|
110
|
-
opacity var(--md-sys-motion-duration-200, 200ms) var(--rc-theme-material-disclosure-easing),
|
|
111
|
-
padding-block var(--md-sys-motion-duration-200, 200ms)
|
|
112
|
-
var(--rc-theme-material-disclosure-easing);
|
|
113
|
-
}
|
|
151
|
+
> summary::after {
|
|
152
|
+
translate: 0 0.125rem;
|
|
153
|
+
rotate: 315deg;
|
|
114
154
|
}
|
|
115
155
|
|
|
116
|
-
|
|
117
|
-
:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
156
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
157
|
+
:is(rc-disclosure, rc-accordion)
|
|
158
|
+
> details
|
|
159
|
+
> summary:active {
|
|
160
|
+
background: color-mix(
|
|
161
|
+
in srgb,
|
|
162
|
+
var(--md-sys-color-on-surface, CanvasText)
|
|
163
|
+
calc(var(--md-sys-state-pressed-state-layer-opacity, 0.12) * 100%),
|
|
164
|
+
transparent
|
|
165
|
+
);
|
|
122
166
|
}
|
|
123
167
|
}
|