@rcarls/rc-theme-material 0.3.2 → 0.4.1
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 +83 -0
- package/README.md +18 -3
- package/bridge.css +185 -14
- package/components/app-bar.css +28 -0
- package/components/bottom-sheet.css +132 -0
- package/components/button.css +57 -0
- package/components/card.css +59 -0
- package/components/chip.css +28 -0
- package/components/combobox.css +18 -5
- package/components/dialog.css +4 -1
- package/components/fab-menu.css +85 -0
- package/components/fab.css +34 -0
- package/components/icons.css +19 -0
- package/components/list-item.css +87 -0
- package/components/listbox.css +4 -2
- package/components/markdown-editor.css +30 -1
- package/components/menu-button.css +2 -0
- package/components/menu.css +5 -6
- package/components/navigation-bar.css +78 -0
- package/components/navigation-rail.css +134 -0
- package/components/search-bar.css +23 -0
- package/components/segmented-button.css +44 -0
- package/components/select.css +20 -6
- package/components/snackbar.css +23 -0
- package/components/switch.css +33 -0
- package/components/transfer-list.css +1 -1
- package/components.css +13 -0
- package/package.json +3 -2
- package/state-layer.css +33 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
@layer rc-theme-material.components {
|
|
2
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-segmented-button {
|
|
3
|
+
--_rc-segmented-button-fieldset-display: inline-flex;
|
|
4
|
+
--_rc-segmented-button-fieldset-margin: 0;
|
|
5
|
+
--_rc-segmented-button-fieldset-padding: 0;
|
|
6
|
+
--_rc-segmented-button-fieldset-border: 0;
|
|
7
|
+
--_rc-segmented-button-fieldset-radius: 0;
|
|
8
|
+
--_rc-segmented-button-fieldset-overflow: visible;
|
|
9
|
+
--_rc-segmented-button-legend-position: absolute;
|
|
10
|
+
--_rc-segmented-button-legend-inline-size: 1px;
|
|
11
|
+
--_rc-segmented-button-legend-block-size: 1px;
|
|
12
|
+
--_rc-segmented-button-legend-margin: -1px;
|
|
13
|
+
--_rc-segmented-button-legend-padding: 0;
|
|
14
|
+
--_rc-segmented-button-legend-border: 0;
|
|
15
|
+
--_rc-segmented-button-legend-overflow: hidden;
|
|
16
|
+
--_rc-segmented-button-legend-clip: rect(0 0 0 0);
|
|
17
|
+
--_rc-segmented-button-legend-white-space: nowrap;
|
|
18
|
+
--_rc-segmented-button-segment-display: inline-flex;
|
|
19
|
+
--_rc-segmented-button-segment-cursor: pointer;
|
|
20
|
+
--_rc-segmented-button-segment-user-select: none;
|
|
21
|
+
--_rc-segmented-button-disabled-cursor: not-allowed;
|
|
22
|
+
--_rc-segmented-button-radio-position: absolute;
|
|
23
|
+
--_rc-segmented-button-radio-inline-size: 1px;
|
|
24
|
+
--_rc-segmented-button-radio-block-size: 1px;
|
|
25
|
+
--_rc-segmented-button-radio-margin: 0;
|
|
26
|
+
--_rc-segmented-button-radio-opacity: 0;
|
|
27
|
+
--_rc-segmented-button-radio-pointer-events: none;
|
|
28
|
+
--_rc-segmented-button-selected-icon-display: inline-grid;
|
|
29
|
+
--_rc-segmented-button-vertical-border-inline-start: 1px solid
|
|
30
|
+
var(--md-sys-color-outline, ButtonBorder);
|
|
31
|
+
--rc-segmented-button-border: 1px solid var(--md-sys-color-outline, ButtonBorder);
|
|
32
|
+
--rc-segmented-button-radius: var(--md-sys-shape-corner-full, 9999px);
|
|
33
|
+
--rc-segmented-button-divider: 0;
|
|
34
|
+
--rc-segmented-button-bg: var(--md-sys-color-surface, ButtonFace);
|
|
35
|
+
--rc-segmented-button-color: var(--md-sys-color-on-surface, ButtonText);
|
|
36
|
+
--rc-segmented-button-selected-bg: var(--md-sys-color-secondary-container, Highlight);
|
|
37
|
+
--rc-segmented-button-selected-color: var(--md-sys-color-on-secondary-container, HighlightText);
|
|
38
|
+
--rc-segmented-button-segment-min-block-size: 2.5rem;
|
|
39
|
+
--rc-segmented-button-segment-padding-inline: 1rem;
|
|
40
|
+
--rc-segmented-button-focus-ring: var(--rc-focus-ring);
|
|
41
|
+
--rc-segmented-button-focus-ring-offset: -2px;
|
|
42
|
+
--rc-segmented-button-disabled-opacity: var(--rc-disabled-opacity);
|
|
43
|
+
}
|
|
44
|
+
}
|
package/components/select.css
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
@layer rc-theme-material.components {
|
|
2
2
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-select::part(trigger) {
|
|
3
3
|
box-sizing: border-box;
|
|
4
|
-
transition:
|
|
4
|
+
transition:
|
|
5
|
+
border-color 150ms ease,
|
|
6
|
+
box-shadow 150ms ease,
|
|
7
|
+
background-color 150ms ease;
|
|
5
8
|
}
|
|
6
9
|
|
|
7
10
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-select::part(trigger):hover {
|
|
8
11
|
border-color: var(--md-sys-color-on-surface, CanvasText);
|
|
9
|
-
background: color-mix(
|
|
12
|
+
background: color-mix(
|
|
13
|
+
in srgb,
|
|
14
|
+
var(--md-sys-color-on-surface, CanvasText) 4%,
|
|
15
|
+
var(--md-sys-color-surface, Field)
|
|
16
|
+
);
|
|
10
17
|
}
|
|
11
18
|
|
|
12
19
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-select::part(trigger):focus-visible,
|
|
13
|
-
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
20
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
21
|
+
rc-select::part(trigger)[aria-expanded='true'] {
|
|
14
22
|
border-color: var(--md-sys-color-primary, Highlight);
|
|
15
23
|
box-shadow: inset 0 0 0 1px var(--md-sys-color-primary, Highlight);
|
|
16
24
|
outline: none;
|
|
@@ -24,7 +32,11 @@
|
|
|
24
32
|
}
|
|
25
33
|
|
|
26
34
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-select::part(chip):hover {
|
|
27
|
-
background: color-mix(
|
|
35
|
+
background: color-mix(
|
|
36
|
+
in srgb,
|
|
37
|
+
var(--md-sys-color-on-surface-variant, CanvasText) 8%,
|
|
38
|
+
transparent
|
|
39
|
+
);
|
|
28
40
|
color: var(--md-sys-color-on-surface-variant, CanvasText);
|
|
29
41
|
}
|
|
30
42
|
|
|
@@ -43,7 +55,7 @@
|
|
|
43
55
|
border-radius: var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 0.25rem));
|
|
44
56
|
|
|
45
57
|
/* Option sizing — inherited by li[role='option'] via rc-listbox's rc-base layer */
|
|
46
|
-
--rc-listbox-option-gap: 0.75rem;
|
|
58
|
+
--rc-listbox-option-gap: var(--rc-list-item-gap, 0.75rem);
|
|
47
59
|
--rc-listbox-option-min-block-size: 3rem;
|
|
48
60
|
--rc-listbox-option-padding-block: 0;
|
|
49
61
|
--rc-listbox-option-padding-inline: 0.75rem;
|
|
@@ -78,7 +90,9 @@
|
|
|
78
90
|
--md-outlined-select-text-field-trailing-icon-color,
|
|
79
91
|
var(--md-sys-color-on-surface-variant, CanvasText)
|
|
80
92
|
);
|
|
81
|
-
transition:
|
|
93
|
+
transition:
|
|
94
|
+
color 150ms ease,
|
|
95
|
+
transform 150ms ease;
|
|
82
96
|
}
|
|
83
97
|
|
|
84
98
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-select[open]::part(toggle-indicator) {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@layer rc-theme-material.components {
|
|
2
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-snackbar {
|
|
3
|
+
--rc-snackbar-inset-block-end: calc(1rem + var(--rc-navigation-bar-block-size, 0px));
|
|
4
|
+
--rc-snackbar-min-block-size: 3rem;
|
|
5
|
+
--rc-snackbar-max-inline-size: 30rem;
|
|
6
|
+
--rc-snackbar-padding-block: 0.875rem;
|
|
7
|
+
--rc-snackbar-padding-inline: 1rem;
|
|
8
|
+
--rc-snackbar-border: 0;
|
|
9
|
+
--rc-snackbar-radius: var(--md-sys-shape-corner-extra-small, 0.25rem);
|
|
10
|
+
--rc-snackbar-bg: var(--md-sys-color-inverse-surface, CanvasText);
|
|
11
|
+
--rc-snackbar-color: var(--md-sys-color-inverse-on-surface, Canvas);
|
|
12
|
+
--rc-snackbar-action-color: var(--md-sys-color-inverse-primary, LinkText);
|
|
13
|
+
--rc-snackbar-action-border: 0;
|
|
14
|
+
--rc-snackbar-action-radius: var(--md-sys-shape-corner-full, 9999px);
|
|
15
|
+
--rc-snackbar-action-padding-block: 0.5rem;
|
|
16
|
+
--rc-snackbar-action-padding-inline: 0.75rem;
|
|
17
|
+
--rc-snackbar-action-bg: transparent;
|
|
18
|
+
--rc-snackbar-action-font: inherit;
|
|
19
|
+
--rc-snackbar-shadow: var(--rc-shadow-level3);
|
|
20
|
+
--rc-snackbar-focus-ring: 2px solid var(--md-sys-color-inverse-primary, Highlight);
|
|
21
|
+
--rc-snackbar-focus-ring-offset: 2px;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@layer rc-theme-material.components {
|
|
2
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-switch {
|
|
3
|
+
--rc-switch-native-appearance: none;
|
|
4
|
+
--rc-switch-native-inline-size: 100%;
|
|
5
|
+
--rc-switch-native-block-size: 100%;
|
|
6
|
+
--rc-switch-native-margin: 0;
|
|
7
|
+
--rc-switch-native-opacity: 0;
|
|
8
|
+
--rc-switch-decoration-display: block;
|
|
9
|
+
--rc-switch-icon-display: grid;
|
|
10
|
+
--rc-switch-track-inline-size: 3.25rem;
|
|
11
|
+
--rc-switch-track-block-size: 2rem;
|
|
12
|
+
--rc-switch-track-border: 2px solid var(--md-sys-color-outline, ButtonBorder);
|
|
13
|
+
--rc-switch-track-radius: var(--md-sys-shape-corner-full, 9999px);
|
|
14
|
+
--rc-switch-track-bg: var(--md-sys-color-surface-container-highest, ButtonFace);
|
|
15
|
+
--rc-switch-thumb-size: 1rem;
|
|
16
|
+
--rc-switch-thumb-offset: 0.375rem;
|
|
17
|
+
--rc-switch-thumb-bg: var(--md-sys-color-outline, ButtonText);
|
|
18
|
+
--rc-switch-selected-track-border-color: var(--md-sys-color-primary, Highlight);
|
|
19
|
+
--rc-switch-selected-track-bg: var(--md-sys-color-primary, Highlight);
|
|
20
|
+
--rc-switch-selected-thumb-size: 1.5rem;
|
|
21
|
+
--rc-switch-selected-thumb-bg: var(--md-sys-color-on-primary, HighlightText);
|
|
22
|
+
--rc-switch-thumb-translate: 1.125rem;
|
|
23
|
+
--rc-switch-focus-ring: var(--rc-focus-ring);
|
|
24
|
+
--rc-switch-focus-ring-offset: var(--rc-focus-ring-offset);
|
|
25
|
+
--rc-switch-disabled-opacity: var(--rc-disabled-opacity);
|
|
26
|
+
--rc-switch-duration: var(--rc-motion-duration);
|
|
27
|
+
|
|
28
|
+
/* Keep long flex/grid siblings from shrinking the control below its track. */
|
|
29
|
+
min-inline-size: var(--rc-switch-track-inline-size) !important;
|
|
30
|
+
min-block-size: var(--rc-switch-track-block-size) !important;
|
|
31
|
+
flex-shrink: 0 !important;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-transfer-list::part(listbox) {
|
|
35
35
|
border-radius: var(--md-sys-shape-corner-small, 0.25rem);
|
|
36
|
-
--rc-listbox-option-gap: 0.75rem;
|
|
36
|
+
--rc-listbox-option-gap: var(--rc-list-item-gap, 0.75rem);
|
|
37
37
|
--rc-listbox-option-min-block-size: 3rem;
|
|
38
38
|
--rc-listbox-option-padding-block: 0;
|
|
39
39
|
--rc-listbox-option-padding-inline: 0.75rem;
|
package/components.css
CHANGED
|
@@ -1,23 +1,36 @@
|
|
|
1
1
|
@layer rc-theme-material.defaults, rc-theme-material.bridge, rc-theme-material.components;
|
|
2
2
|
|
|
3
|
+
@import './components/icons.css';
|
|
3
4
|
@import './components/listbox.css';
|
|
4
5
|
@import './components/select.css';
|
|
5
6
|
@import './components/combobox.css';
|
|
6
7
|
@import './components/search-bar.css';
|
|
8
|
+
@import './components/bottom-sheet.css';
|
|
7
9
|
@import './components/textarea.css';
|
|
8
10
|
@import './components/markdown-editor.css';
|
|
9
11
|
@import './components/transfer-list.css';
|
|
12
|
+
@import './components/button.css';
|
|
13
|
+
@import './components/card.css';
|
|
14
|
+
@import './components/chip.css';
|
|
15
|
+
@import './components/list-item.css';
|
|
10
16
|
@import './components/fab.css';
|
|
17
|
+
@import './components/fab-menu.css';
|
|
11
18
|
@import './components/app-bar.css';
|
|
12
19
|
@import './components/menu.css';
|
|
13
20
|
@import './components/menu-button.css';
|
|
14
21
|
@import './components/menubar.css';
|
|
22
|
+
@import './components/navigation-bar.css';
|
|
23
|
+
@import './components/navigation-rail.css';
|
|
15
24
|
@import './components/toolbar.css';
|
|
25
|
+
@import './components/segmented-button.css';
|
|
16
26
|
@import './components/slider.css';
|
|
27
|
+
@import './components/snackbar.css';
|
|
17
28
|
@import './components/range-slider.css';
|
|
18
29
|
@import './components/splitter.css';
|
|
30
|
+
@import './components/switch.css';
|
|
19
31
|
@import './components/dialog.css';
|
|
20
32
|
@import './components/disclosure.css';
|
|
21
33
|
@import './components/accordion.css';
|
|
22
34
|
@import './components/virtual-canvas.css';
|
|
23
35
|
@import './components/modes.css';
|
|
36
|
+
@import './state-layer.css';
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.4.1",
|
|
7
7
|
"description": "Material 3 CSS theme and token bridge for rc-webcomponents.",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"./defaults.css": "./defaults.css",
|
|
23
23
|
"./components.css": "./components.css",
|
|
24
24
|
"./components/*.css": "./components/*.css",
|
|
25
|
+
"./state-layer.css": "./state-layer.css",
|
|
25
26
|
"./theme.css": "./theme.css"
|
|
26
27
|
},
|
|
27
28
|
"files": [
|
|
@@ -41,4 +42,4 @@
|
|
|
41
42
|
"vite": "^7.1.7",
|
|
42
43
|
"vitest": "^4.0.6"
|
|
43
44
|
}
|
|
44
|
-
}
|
|
45
|
+
}
|
package/state-layer.css
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@layer rc-theme-material.components {
|
|
2
|
+
/*
|
|
3
|
+
* Material 3 state layers for interactive elements that already own their
|
|
4
|
+
* border radius. Uses currentColor so the layer follows each component's
|
|
5
|
+
* foreground token.
|
|
6
|
+
*/
|
|
7
|
+
.rc-state-layer {
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.rc-state-layer::after {
|
|
12
|
+
content: '';
|
|
13
|
+
position: absolute;
|
|
14
|
+
inset: 0;
|
|
15
|
+
border-radius: inherit;
|
|
16
|
+
background: currentColor;
|
|
17
|
+
opacity: 0;
|
|
18
|
+
pointer-events: none;
|
|
19
|
+
transition: opacity 150ms var(--md-sys-motion-easing-standard, cubic-bezier(0.4, 0, 0.2, 1));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.rc-state-layer:hover::after {
|
|
23
|
+
opacity: var(--md-sys-state-hover-state-layer-opacity, 0.08);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.rc-state-layer:focus-visible::after {
|
|
27
|
+
opacity: var(--md-sys-state-focus-state-layer-opacity, 0.12);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.rc-state-layer:active::after {
|
|
31
|
+
opacity: var(--md-sys-state-pressed-state-layer-opacity, 0.12);
|
|
32
|
+
}
|
|
33
|
+
}
|