@rcarls/rc-theme-substrate 0.3.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/README.md ADDED
@@ -0,0 +1,73 @@
1
+ # `@rcarls/rc-theme-substrate`
2
+
3
+ Lightweight CSS reference theme for app-oriented `rc-webcomponents` layouts.
4
+
5
+ Docs: [https://richardcarls.github.io/rc-webcomponents/guide/theme-previews](https://richardcarls.github.io/rc-webcomponents/guide/theme-previews).
6
+
7
+ It is a CSS-only, app-oriented foundation theme: orange primary color,
8
+ neutral surfaces, compact controls, system-color fallbacks, and a small set of
9
+ component polish rules that demonstrate how to build a branded theme without
10
+ copying the heavier Material package.
11
+
12
+ ## Installation
13
+
14
+ ```sh
15
+ yarn add @rcarls/rc-theme-substrate
16
+ ```
17
+
18
+ ## Full reference theme
19
+
20
+ Import the full theme bundle:
21
+
22
+ ```css
23
+ @import '@rcarls/rc-theme-substrate/theme.css';
24
+ ```
25
+
26
+ Apply the theme class to your app shell or any subtree:
27
+
28
+ ```html
29
+ <main class="rc-theme-substrate">
30
+ <rc-select>...</rc-select>
31
+ <rc-dialog>...</rc-dialog>
32
+ </main>
33
+ ```
34
+
35
+ ## Build your own theme from it
36
+
37
+ Substrate is intentionally token-first. To use it as a branded foundation,
38
+ copy the `bridge.css` pattern and override the public semantic tokens at your
39
+ theme boundary.
40
+
41
+ ```css
42
+ @import '@rcarls/rc-theme-substrate/bridge.css';
43
+ @import '@rcarls/rc-theme-substrate/components.css';
44
+
45
+ .my-product-theme {
46
+ --substrate-primary: oklch(58% 0.19 275);
47
+ --substrate-radius-md: 0.5rem;
48
+ --substrate-font-family: Inter, system-ui, sans-serif;
49
+ }
50
+ ```
51
+
52
+ Selective component styles are exported for apps that want only part of the
53
+ reference layer:
54
+
55
+ ```css
56
+ @import '@rcarls/rc-theme-substrate/bridge.css';
57
+ @import '@rcarls/rc-theme-substrate/components/select.css';
58
+ @import '@rcarls/rc-theme-substrate/components/dialog.css';
59
+ ```
60
+
61
+ ## View transitions
62
+
63
+ Substrate includes stable CSS hooks for apps that opt into View Transitions,
64
+ but it does not start transitions or require browser support:
65
+
66
+ ```css
67
+ .rc-theme-substrate [data-rc-view-transition='panel'] {
68
+ --rc-view-transition-name: rc-panel;
69
+ }
70
+ ```
71
+
72
+ Application code remains responsible for deciding when to call
73
+ `document.startViewTransition()`.
package/bridge.css ADDED
@@ -0,0 +1,106 @@
1
+ @layer rc-theme-substrate.defaults, rc-theme-substrate.bridge, rc-theme-substrate.components;
2
+
3
+ @layer rc-theme-substrate.bridge {
4
+ /*
5
+ * Maps Substrate's small brand token set to the rc-webcomponents public
6
+ * styling contract. Consumers can replace --substrate-* values and keep this
7
+ * file as their bridge.
8
+ */
9
+ .rc-theme-substrate,
10
+ :host(.rc-theme-substrate) {
11
+ --rc-surface: var(--substrate-surface, Canvas);
12
+ --rc-field: var(--substrate-field, Field);
13
+ --rc-button-bg: var(--substrate-surface-raised, ButtonFace);
14
+ --rc-field-text: var(--substrate-on-surface, FieldText);
15
+ --rc-button-text: var(--substrate-on-surface, ButtonText);
16
+ --rc-highlight: var(--substrate-primary-container, Highlight);
17
+ --rc-highlight-text: var(--substrate-on-primary-container, HighlightText);
18
+ --rc-text-disabled: var(--substrate-on-surface-muted, GrayText);
19
+ --rc-accent: var(--substrate-primary, Highlight);
20
+ --rc-border-color: var(--substrate-border-color, ButtonBorder);
21
+ --rc-border-width: 1px;
22
+ --rc-border-style: solid;
23
+ --rc-border: var(--rc-border-width) var(--rc-border-style) var(--rc-border-color);
24
+ --rc-shadow: var(--substrate-shadow-md, 0 2px 8px rgb(0 0 0 / 15%));
25
+ --rc-font-family: var(--substrate-font-family, inherit);
26
+ --rc-font-size: var(--substrate-font-size, 1em);
27
+ --rc-font-weight: var(--substrate-font-weight, 400);
28
+ --rc-line-height: var(--substrate-line-height, normal);
29
+ --rc-control-block-size: var(--substrate-control-block-size, 2.5rem);
30
+ --rc-control-padding-block: var(--substrate-control-padding-block, 0.5rem);
31
+ --rc-control-padding-inline: var(--substrate-control-padding-inline, 0.75rem);
32
+ --rc-control-gap: var(--substrate-control-gap, 0.5rem);
33
+ --rc-item-padding-block: var(--substrate-item-padding-block, 0.55rem);
34
+ --rc-item-padding-inline: var(--substrate-item-padding-inline, 0.75rem);
35
+ --rc-item-gap: var(--substrate-item-gap, 0.5rem);
36
+ --rc-radius-sm: var(--substrate-radius-sm, 0.25rem);
37
+ --rc-radius-md: var(--substrate-radius-md, 0.5rem);
38
+ --rc-control-radius: var(--substrate-radius-md, 0.5rem);
39
+ --rc-focus-ring: var(--substrate-focus-ring, 2px solid Highlight);
40
+ --rc-focus-ring-offset: var(--substrate-focus-ring-offset, 2px);
41
+ --rc-disabled-opacity: var(--substrate-disabled-opacity, 0.52);
42
+ --rc-motion-duration: var(--substrate-motion-duration, 160ms);
43
+ }
44
+
45
+ .rc-theme-substrate rc-listbox,
46
+ :host(.rc-theme-substrate) rc-listbox,
47
+ .rc-theme-substrate rc-menu,
48
+ :host(.rc-theme-substrate) rc-menu {
49
+ --rc-listbox-option-gap: var(--substrate-item-gap, 0.5rem);
50
+ --rc-listbox-option-min-block-size: 2.25rem;
51
+ --rc-listbox-option-padding-block: var(--substrate-item-padding-block, 0.55rem);
52
+ --rc-listbox-option-padding-inline: var(--substrate-item-padding-inline, 0.75rem);
53
+ --rc-listbox-hover-bg: color-mix(in srgb, var(--rc-accent, Highlight) 10%, transparent);
54
+ --rc-listbox-hover-color: var(--rc-field-text, FieldText);
55
+ --rc-listbox-active-bg: color-mix(in srgb, var(--rc-accent, Highlight) 16%, transparent);
56
+ --rc-listbox-active-color: var(--rc-field-text, FieldText);
57
+ --rc-listbox-selected-bg: var(--rc-highlight, Highlight);
58
+ --rc-listbox-selected-color: var(--rc-highlight-text, HighlightText);
59
+ }
60
+
61
+ .rc-theme-substrate rc-select,
62
+ :host(.rc-theme-substrate) rc-select,
63
+ .rc-theme-substrate rc-combobox,
64
+ :host(.rc-theme-substrate) rc-combobox {
65
+ --rc-select-control-block-size: var(--rc-control-block-size);
66
+ --rc-select-radius: var(--rc-control-radius);
67
+ --rc-select-shadow: var(--rc-shadow);
68
+ --rc-select-listbox-radius: var(--substrate-radius-lg, 0.75rem);
69
+ --rc-select-listbox-border: var(--rc-border);
70
+ --rc-select-chip-radius: var(--substrate-radius-sm, 0.25rem);
71
+ --rc-combobox-control-block-size: var(--rc-control-block-size);
72
+ --rc-combobox-radius: var(--rc-control-radius);
73
+ --rc-combobox-shadow: var(--rc-shadow);
74
+ --rc-combobox-listbox-radius: var(--substrate-radius-lg, 0.75rem);
75
+ --rc-combobox-listbox-border: var(--rc-border);
76
+ --rc-combobox-chip-radius: var(--substrate-radius-sm, 0.25rem);
77
+ }
78
+
79
+ .rc-theme-substrate rc-slider,
80
+ :host(.rc-theme-substrate) rc-slider,
81
+ .rc-theme-substrate rc-range-slider,
82
+ :host(.rc-theme-substrate) rc-range-slider {
83
+ --rc-slider-track-size: 0.375rem;
84
+ --rc-slider-track-background: color-mix(in srgb, var(--rc-border-color) 70%, transparent);
85
+ --rc-slider-progress-background: var(--rc-accent);
86
+ --rc-slider-track-radius: 999px;
87
+ --rc-range-slider-accent: var(--rc-accent);
88
+ --rc-range-slider-track-background: color-mix(
89
+ in srgb,
90
+ var(--rc-border-color) 70%,
91
+ transparent
92
+ );
93
+ --rc-range-slider-thumb-background: var(--substrate-surface, Canvas);
94
+ --rc-range-slider-thumb-border: var(--rc-accent);
95
+ --rc-thumb-radius: 0.5625rem;
96
+ }
97
+
98
+ @media (prefers-reduced-motion: reduce) {
99
+ .rc-theme-substrate,
100
+ :host(.rc-theme-substrate) {
101
+ --substrate-motion-duration: 0ms;
102
+ --substrate-motion-duration-slow: 0ms;
103
+ --rc-motion-duration: 0ms;
104
+ }
105
+ }
106
+ }
@@ -0,0 +1,119 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-accordion {
3
+ display: grid;
4
+ gap: 0.5rem;
5
+ }
6
+
7
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-accordion > details,
8
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-accordion > rc-disclosure > details {
9
+ border: var(--rc-border, 1px solid ButtonBorder);
10
+ border-radius: var(--substrate-radius-lg, 0.75rem);
11
+ background: var(--substrate-surface-raised, Canvas);
12
+ overflow: clip;
13
+ transition:
14
+ border-color var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease),
15
+ box-shadow var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
16
+ }
17
+
18
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-accordion > details[open],
19
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
20
+ rc-accordion
21
+ > rc-disclosure
22
+ > details[open] {
23
+ box-shadow: var(--substrate-shadow-sm, none);
24
+ }
25
+
26
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-accordion summary,
27
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-accordion > rc-disclosure summary {
28
+ display: grid;
29
+ grid-template-columns: minmax(0, 1fr) auto;
30
+ gap: 0.75rem;
31
+ align-items: center;
32
+ min-block-size: 2.75rem;
33
+ padding-block: 0.75rem;
34
+ padding-inline: 0.875rem;
35
+ cursor: pointer;
36
+ font-weight: 650;
37
+ transition:
38
+ background-color var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease),
39
+ color var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
40
+ }
41
+
42
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-accordion summary:hover {
43
+ background: color-mix(in srgb, var(--rc-accent, Highlight) 8%, transparent);
44
+ }
45
+
46
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-accordion summary::marker {
47
+ content: '';
48
+ }
49
+
50
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
51
+ rc-accordion
52
+ summary::-webkit-details-marker {
53
+ display: none;
54
+ }
55
+
56
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-accordion summary::after {
57
+ content: '';
58
+ inline-size: 0.5rem;
59
+ block-size: 0.5rem;
60
+ border-block-start: 2px solid currentColor;
61
+ border-inline-end: 2px solid currentColor;
62
+ rotate: 45deg;
63
+ transition:
64
+ rotate var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease),
65
+ translate var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
66
+ }
67
+
68
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-accordion details[open] > summary::after {
69
+ rotate: 135deg;
70
+ translate: 0 -0.125rem;
71
+ }
72
+
73
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-accordion details > :not(summary) {
74
+ display: flow-root;
75
+ padding-inline: 0.875rem;
76
+ opacity: 1;
77
+ transition:
78
+ opacity var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease),
79
+ translate var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
80
+ }
81
+
82
+ @supports selector(::details-content) {
83
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-accordion details {
84
+ interpolate-size: allow-keywords;
85
+ }
86
+
87
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-accordion details::details-content {
88
+ block-size: 0;
89
+ content-visibility: hidden;
90
+ opacity: 0;
91
+ overflow: clip;
92
+ transition:
93
+ block-size var(--substrate-motion-duration-slow, 240ms)
94
+ var(--substrate-motion-easing, ease),
95
+ content-visibility var(--substrate-motion-duration-slow, 240ms)
96
+ var(--substrate-motion-easing, ease) allow-discrete,
97
+ opacity var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
98
+ transition-behavior: allow-discrete;
99
+ }
100
+
101
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
102
+ rc-accordion
103
+ details[open]::details-content {
104
+ block-size: auto;
105
+ content-visibility: visible;
106
+ opacity: 1;
107
+ }
108
+ }
109
+
110
+ @starting-style {
111
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
112
+ rc-accordion
113
+ details[open]
114
+ > :not(summary) {
115
+ opacity: 0;
116
+ translate: 0 -0.25rem;
117
+ }
118
+ }
119
+ }
@@ -0,0 +1,25 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-app-bar {
3
+ --rc-app-bar-background: color-mix(
4
+ in srgb,
5
+ var(--substrate-surface, Canvas) 88%,
6
+ transparent
7
+ );
8
+ --rc-app-bar-color: var(--rc-field-text, CanvasText);
9
+ --rc-app-bar-scroll-divider: var(--rc-border, 1px solid ButtonBorder);
10
+ --rc-app-bar-shadow: none;
11
+ -webkit-backdrop-filter: blur(16px);
12
+ backdrop-filter: blur(16px);
13
+ font-family: var(--rc-font-family, inherit);
14
+ position: relative;
15
+ z-index: var(--rc-app-bar-z-index, 1);
16
+ }
17
+
18
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-app-bar[data-scrolled] {
19
+ --rc-app-bar-shadow: var(--substrate-shadow-sm, none);
20
+ }
21
+
22
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-app-bar :is(button, [role='button']) {
23
+ border-radius: var(--substrate-radius-md, 0.5rem);
24
+ }
25
+ }
@@ -0,0 +1,54 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-combobox {
3
+ display: inline-block;
4
+ }
5
+
6
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-combobox::part(anchor) {
7
+ min-block-size: var(--rc-control-block-size, 2.5rem);
8
+ border: var(--rc-border, 1px solid ButtonBorder);
9
+ border-radius: var(--rc-control-radius, 0.5rem);
10
+ background: var(--rc-field, Field);
11
+ color: var(--rc-field-text, FieldText);
12
+ transition:
13
+ border-color var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease),
14
+ box-shadow var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
15
+ }
16
+
17
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-combobox::part(anchor):hover {
18
+ border-color: color-mix(in srgb, var(--rc-accent, Highlight) 55%, var(--rc-border-color));
19
+ }
20
+
21
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-combobox::part(anchor):focus-within {
22
+ outline: var(--rc-focus-ring, 2px solid Highlight);
23
+ outline-offset: var(--rc-focus-ring-offset, 2px);
24
+ box-shadow: 0 0 0 4px color-mix(in srgb, var(--rc-accent, Highlight) 16%, transparent);
25
+ }
26
+
27
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-combobox::part(listbox) {
28
+ --rc-listbox-option-gap: var(--substrate-item-gap, 0.5rem);
29
+ --rc-listbox-option-min-block-size: 2.25rem;
30
+ --rc-listbox-option-padding-block: var(--substrate-item-padding-block, 0.55rem);
31
+ --rc-listbox-option-padding-inline: var(--substrate-item-padding-inline, 0.75rem);
32
+ --rc-listbox-hover-bg: color-mix(in srgb, var(--rc-accent, Highlight) 10%, transparent);
33
+ --rc-listbox-hover-color: var(--rc-field-text, FieldText);
34
+ --rc-listbox-active-bg: color-mix(in srgb, var(--rc-accent, Highlight) 16%, transparent);
35
+ --rc-listbox-active-color: var(--rc-field-text, FieldText);
36
+ --rc-listbox-selected-bg: var(--rc-highlight, Highlight);
37
+ --rc-listbox-selected-color: var(--rc-highlight-text, HighlightText);
38
+ border: var(--rc-border, 1px solid ButtonBorder);
39
+ border-radius: var(--substrate-radius-lg, 0.75rem);
40
+ background: var(--substrate-surface-raised, Canvas);
41
+ box-shadow: var(--rc-shadow, none);
42
+ padding-block: 0.25rem;
43
+ }
44
+
45
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-combobox::part(toggle) {
46
+ border-radius: var(--substrate-radius-sm, 0.25rem);
47
+ transition: background-color var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
48
+ }
49
+
50
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-combobox::part(toggle):hover,
51
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-combobox[open]::part(toggle) {
52
+ background: color-mix(in srgb, var(--rc-accent, Highlight) 12%, transparent);
53
+ }
54
+ }
@@ -0,0 +1,35 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-dialog > dialog {
3
+ border: var(--rc-border, 1px solid ButtonBorder);
4
+ border-radius: var(--substrate-radius-xl, 1rem);
5
+ background: var(--substrate-surface-raised, Canvas);
6
+ color: var(--rc-field-text, CanvasText);
7
+ box-shadow: var(--substrate-shadow-lg, none);
8
+ opacity: 1;
9
+ transform: translateY(0) scale(1);
10
+ transition:
11
+ display var(--substrate-motion-duration-slow, 240ms) allow-discrete,
12
+ overlay var(--substrate-motion-duration-slow, 240ms) allow-discrete,
13
+ opacity var(--substrate-motion-duration-slow, 240ms) var(--substrate-motion-easing, ease),
14
+ transform var(--substrate-motion-duration-slow, 240ms) var(--substrate-motion-easing, ease);
15
+ transition-behavior: allow-discrete;
16
+ }
17
+
18
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-dialog > dialog::backdrop {
19
+ background: color-mix(in srgb, CanvasText 32%, transparent);
20
+ transition: opacity var(--substrate-motion-duration-slow, 240ms)
21
+ var(--substrate-motion-easing, ease);
22
+ }
23
+
24
+ @starting-style {
25
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-dialog > dialog[open] {
26
+ opacity: 0;
27
+ transform: translateY(0.5rem) scale(0.98);
28
+ }
29
+ }
30
+
31
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-dialog > dialog:not([open]) {
32
+ opacity: 0;
33
+ transform: translateY(0.5rem) scale(0.98);
34
+ }
35
+ }
@@ -0,0 +1,130 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-disclosure {
3
+ display: block;
4
+ }
5
+
6
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-disclosure > details {
7
+ border: var(--rc-border, 1px solid ButtonBorder);
8
+ border-radius: var(--substrate-radius-lg, 0.75rem);
9
+ background: var(--substrate-surface-raised, Canvas);
10
+ overflow: clip;
11
+ transition:
12
+ border-color var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease),
13
+ box-shadow var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
14
+ }
15
+
16
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-disclosure > details[open] {
17
+ box-shadow: var(--substrate-shadow-sm, none);
18
+ }
19
+
20
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-disclosure > details > summary {
21
+ display: grid;
22
+ grid-template-columns: minmax(0, 1fr) auto;
23
+ gap: 0.75rem;
24
+ align-items: center;
25
+ min-block-size: 2.75rem;
26
+ padding-block: 0.75rem;
27
+ padding-inline: 0.875rem;
28
+ cursor: pointer;
29
+ font-weight: 650;
30
+ transition:
31
+ background-color var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease),
32
+ color var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
33
+ }
34
+
35
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
36
+ rc-disclosure
37
+ > details
38
+ > summary::marker {
39
+ content: '';
40
+ }
41
+
42
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
43
+ rc-disclosure
44
+ > details
45
+ > summary::-webkit-details-marker {
46
+ display: none;
47
+ }
48
+
49
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
50
+ rc-disclosure
51
+ > details
52
+ > summary::after {
53
+ content: '';
54
+ inline-size: 0.5rem;
55
+ block-size: 0.5rem;
56
+ border-block-start: 2px solid currentColor;
57
+ border-inline-end: 2px solid currentColor;
58
+ rotate: 45deg;
59
+ transition:
60
+ rotate var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease),
61
+ translate var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
62
+ }
63
+
64
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
65
+ rc-disclosure
66
+ > details[open]
67
+ > summary::after {
68
+ rotate: 135deg;
69
+ translate: 0 -0.125rem;
70
+ }
71
+
72
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
73
+ rc-disclosure
74
+ > details
75
+ > summary:hover {
76
+ background: color-mix(in srgb, var(--rc-accent, Highlight) 8%, transparent);
77
+ }
78
+
79
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
80
+ rc-disclosure
81
+ > details
82
+ > :not(summary) {
83
+ display: flow-root;
84
+ padding-inline: 0.875rem;
85
+ opacity: 1;
86
+ transition:
87
+ opacity var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease),
88
+ translate var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
89
+ }
90
+
91
+ @supports selector(::details-content) {
92
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-disclosure > details {
93
+ interpolate-size: allow-keywords;
94
+ }
95
+
96
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
97
+ rc-disclosure
98
+ > details::details-content {
99
+ block-size: 0;
100
+ content-visibility: hidden;
101
+ opacity: 0;
102
+ overflow: clip;
103
+ transition:
104
+ block-size var(--substrate-motion-duration-slow, 240ms)
105
+ var(--substrate-motion-easing, ease),
106
+ content-visibility var(--substrate-motion-duration-slow, 240ms)
107
+ var(--substrate-motion-easing, ease) allow-discrete,
108
+ opacity var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
109
+ transition-behavior: allow-discrete;
110
+ }
111
+
112
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
113
+ rc-disclosure
114
+ > details[open]::details-content {
115
+ block-size: auto;
116
+ content-visibility: visible;
117
+ opacity: 1;
118
+ }
119
+ }
120
+
121
+ @starting-style {
122
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
123
+ rc-disclosure
124
+ > details[open]
125
+ > :not(summary) {
126
+ opacity: 0;
127
+ translate: 0 -0.25rem;
128
+ }
129
+ }
130
+ }
@@ -0,0 +1,23 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-fab {
3
+ --rc-fab-bg: var(--rc-accent, Highlight);
4
+ --rc-fab-color: var(--substrate-on-primary, HighlightText);
5
+ --rc-fab-radius: var(--substrate-radius-lg, 0.75rem);
6
+ --rc-fab-shadow: var(--substrate-shadow-md, none);
7
+ }
8
+
9
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-fab > button {
10
+ transition:
11
+ box-shadow var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease),
12
+ transform var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
13
+ }
14
+
15
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-fab > button:hover {
16
+ box-shadow: var(--substrate-shadow-lg, none);
17
+ transform: translateY(-1px);
18
+ }
19
+
20
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-fab > button:active {
21
+ transform: translateY(0);
22
+ }
23
+ }
@@ -0,0 +1,27 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-listbox {
3
+ --rc-listbox-option-gap: var(--substrate-item-gap, 0.5rem);
4
+ --rc-listbox-option-min-block-size: 2.25rem;
5
+ --rc-listbox-option-padding-block: var(--substrate-item-padding-block, 0.55rem);
6
+ --rc-listbox-option-padding-inline: var(--substrate-item-padding-inline, 0.75rem);
7
+ --rc-listbox-option-transition:
8
+ background-color var(--substrate-motion-duration, 160ms)
9
+ var(--substrate-motion-easing, ease),
10
+ color var(--substrate-motion-duration, 160ms) var(--substrate-motion-easing, ease);
11
+ --rc-listbox-hover-bg: color-mix(in srgb, var(--rc-accent, Highlight) 10%, transparent);
12
+ --rc-listbox-hover-color: var(--rc-field-text, FieldText);
13
+ --rc-listbox-active-bg: color-mix(in srgb, var(--rc-accent, Highlight) 16%, transparent);
14
+ --rc-listbox-active-color: var(--rc-field-text, FieldText);
15
+ --rc-listbox-selected-bg: var(--rc-highlight, Highlight);
16
+ --rc-listbox-selected-color: var(--rc-highlight-text, HighlightText);
17
+ display: block;
18
+ border-radius: var(--substrate-radius-lg, 0.75rem);
19
+ font: var(--rc-font-weight, 400) var(--rc-font-size, 1em) / var(--rc-line-height, normal)
20
+ var(--rc-font-family, inherit);
21
+ }
22
+
23
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-listbox[checkmark]
24
+ [part~='option-checkmark'] {
25
+ color: var(--rc-accent, Highlight);
26
+ }
27
+ }
@@ -0,0 +1,15 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-markdown-editor {
3
+ --rme-padding: 0.75rem;
4
+ --rme-border: var(--rc-border, 1px solid ButtonBorder);
5
+ --rme-radius: var(--substrate-radius-lg, 0.75rem);
6
+ --rme-background: var(--rc-field, Field);
7
+ --rme-color: var(--rc-field-text, FieldText);
8
+ --rme-toolbar-background: var(--substrate-surface-raised, Canvas);
9
+ --rme-toolbar-border: var(--rc-border, 1px solid ButtonBorder);
10
+ }
11
+
12
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-markdown-editor::part(rich-view) {
13
+ line-height: var(--rc-line-height, normal);
14
+ }
15
+ }
@@ -0,0 +1,17 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-menu-button {
3
+ --rc-menu-button-trigger-background: var(--rc-button-bg, ButtonFace);
4
+ --rc-menu-button-trigger-color: var(--rc-button-text, ButtonText);
5
+ --rc-menu-button-trigger-hover-background: color-mix(
6
+ in srgb,
7
+ var(--rc-accent, Highlight) 10%,
8
+ var(--rc-button-bg, ButtonFace)
9
+ );
10
+ --rc-menu-button-trigger-open-background: color-mix(
11
+ in srgb,
12
+ var(--rc-accent, Highlight) 16%,
13
+ var(--rc-button-bg, ButtonFace)
14
+ );
15
+ display: inline-block;
16
+ }
17
+ }
@@ -0,0 +1,24 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-menu {
3
+ --rc-menu-item-gap: var(--substrate-item-gap, 0.5rem);
4
+ --rc-menu-item-min-block-size: 2.25rem;
5
+ --rc-menu-item-padding-block: var(--substrate-item-padding-block, 0.55rem);
6
+ --rc-menu-item-padding-inline: var(--substrate-item-padding-inline, 0.75rem);
7
+ --rc-menu-hover-bg: color-mix(in srgb, var(--rc-accent, Highlight) 10%, transparent);
8
+ --rc-menu-active-bg: color-mix(in srgb, var(--rc-accent, Highlight) 16%, transparent);
9
+ --rc-menu-check-size: 1.25rem;
10
+ --rc-menu-submenu-indicator-color: var(--rc-accent, Highlight);
11
+ display: inline-block;
12
+ border: var(--rc-border, 1px solid ButtonBorder);
13
+ border-radius: var(--substrate-radius-lg, 0.75rem);
14
+ background: var(--substrate-surface-raised, Canvas);
15
+ box-shadow: var(--rc-shadow, none);
16
+ padding-block: 0.25rem;
17
+ }
18
+
19
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-menu [data-group-label] {
20
+ color: var(--substrate-on-surface-muted, GrayText);
21
+ font-size: 0.8em;
22
+ font-weight: 650;
23
+ }
24
+ }
@@ -0,0 +1,17 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-menubar {
3
+ --rc-menubar-item-block-size: 2.25rem;
4
+ --rc-menubar-item-padding-inline: 0.75rem;
5
+ --rc-menubar-item-background: transparent;
6
+ --rc-menubar-item-open-background: color-mix(
7
+ in srgb,
8
+ var(--rc-accent, Highlight) 14%,
9
+ transparent
10
+ );
11
+ display: inline-block;
12
+ }
13
+
14
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-menubar::part(root) {
15
+ gap: 0.125rem;
16
+ }
17
+ }
@@ -0,0 +1,24 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) {
3
+ background: var(--substrate-surface, Canvas);
4
+ color: var(--substrate-on-surface, CanvasText);
5
+ font-family: var(--rc-font-family, inherit);
6
+ }
7
+
8
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) *,
9
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) *::before,
10
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) *::after {
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) :focus-visible {
15
+ outline: var(--rc-focus-ring, 2px solid Highlight);
16
+ outline-offset: var(--rc-focus-ring-offset, 2px);
17
+ }
18
+
19
+ @supports (view-transition-name: none) {
20
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) [data-rc-view-transition] {
21
+ view-transition-name: var(--rc-view-transition-name, none);
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,18 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-range-slider::part(thumb) {
3
+ box-shadow: var(--substrate-shadow-sm, none);
4
+ transition:
5
+ border-color var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease),
6
+ box-shadow var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease),
7
+ scale var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
8
+ }
9
+
10
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-range-slider::part(thumb):hover {
11
+ scale: 1.04;
12
+ }
13
+
14
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-range-slider::part(value-display) {
15
+ color: var(--substrate-on-surface-muted, GrayText);
16
+ font-variant-numeric: tabular-nums;
17
+ }
18
+ }
@@ -0,0 +1,28 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-search-bar {
3
+ display: inline-block;
4
+ --rc-search-bar-radius: var(--substrate-radius-lg, 0.75rem);
5
+ --rc-search-bar-border: var(--rc-border, 1px solid ButtonBorder);
6
+ --rc-search-bar-shadow: var(--substrate-shadow-sm, none);
7
+ }
8
+
9
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-search-bar::part(root) {
10
+ background: var(--rc-field, Field);
11
+ transition:
12
+ border-color var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease),
13
+ box-shadow var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
14
+ }
15
+
16
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-search-bar:hover::part(root) {
17
+ border-color: color-mix(in srgb, var(--rc-accent, Highlight) 55%, var(--rc-border-color));
18
+ }
19
+
20
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-search-bar:focus-within::part(root) {
21
+ outline: var(--rc-focus-ring, 2px solid Highlight);
22
+ outline-offset: var(--rc-focus-ring-offset, 2px);
23
+ }
24
+
25
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-search-bar > input[type='search']:focus-visible {
26
+ outline: none;
27
+ }
28
+ }
@@ -0,0 +1,53 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-select {
3
+ display: inline-block;
4
+ }
5
+
6
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-select::part(trigger) {
7
+ min-block-size: var(--rc-control-block-size, 2.5rem);
8
+ border: var(--rc-border, 1px solid ButtonBorder);
9
+ border-radius: var(--rc-control-radius, 0.5rem);
10
+ background: var(--rc-field, Field);
11
+ color: var(--rc-field-text, FieldText);
12
+ transition:
13
+ border-color var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease),
14
+ box-shadow var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease),
15
+ background-color var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
16
+ }
17
+
18
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-select::part(trigger):hover {
19
+ border-color: color-mix(in srgb, var(--rc-accent, Highlight) 55%, var(--rc-border-color));
20
+ }
21
+
22
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-select::part(trigger):focus-visible,
23
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
24
+ rc-select::part(trigger)[aria-expanded='true'] {
25
+ outline: var(--rc-focus-ring, 2px solid Highlight);
26
+ outline-offset: var(--rc-focus-ring-offset, 2px);
27
+ box-shadow: 0 0 0 4px color-mix(in srgb, var(--rc-accent, Highlight) 16%, transparent);
28
+ }
29
+
30
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-select::part(listbox) {
31
+ --rc-listbox-option-gap: var(--substrate-item-gap, 0.5rem);
32
+ --rc-listbox-option-min-block-size: 2.25rem;
33
+ --rc-listbox-option-padding-block: var(--substrate-item-padding-block, 0.55rem);
34
+ --rc-listbox-option-padding-inline: var(--substrate-item-padding-inline, 0.75rem);
35
+ --rc-listbox-hover-bg: color-mix(in srgb, var(--rc-accent, Highlight) 10%, transparent);
36
+ --rc-listbox-hover-color: var(--rc-field-text, FieldText);
37
+ --rc-listbox-active-bg: color-mix(in srgb, var(--rc-accent, Highlight) 16%, transparent);
38
+ --rc-listbox-active-color: var(--rc-field-text, FieldText);
39
+ --rc-listbox-selected-bg: var(--rc-highlight, Highlight);
40
+ --rc-listbox-selected-color: var(--rc-highlight-text, HighlightText);
41
+ border: var(--rc-border, 1px solid ButtonBorder);
42
+ border-radius: var(--substrate-radius-lg, 0.75rem);
43
+ background: var(--substrate-surface-raised, Canvas);
44
+ box-shadow: var(--rc-shadow, none);
45
+ padding-block: 0.25rem;
46
+ }
47
+
48
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-select::part(chip) {
49
+ border-radius: var(--substrate-radius-sm, 0.25rem);
50
+ background: var(--rc-highlight, Highlight);
51
+ color: var(--rc-highlight-text, HighlightText);
52
+ }
53
+ }
@@ -0,0 +1,10 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-slider::part(value-display) {
3
+ color: var(--substrate-on-surface-muted, GrayText);
4
+ font-variant-numeric: tabular-nums;
5
+ }
6
+
7
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-slider input[type='range'] {
8
+ accent-color: var(--rc-accent, Highlight);
9
+ }
10
+ }
@@ -0,0 +1,14 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-splitter {
3
+ --rc-splitter-separator-color: color-mix(
4
+ in srgb,
5
+ var(--rc-accent, Highlight) 8%,
6
+ Canvas
7
+ );
8
+ --rc-splitter-handle-color: color-mix(
9
+ in srgb,
10
+ var(--rc-accent, Highlight) 45%,
11
+ ButtonBorder
12
+ );
13
+ }
14
+ }
@@ -0,0 +1,20 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-textarea {
3
+ --rc-textarea-padding: 0.75rem;
4
+ --rc-textarea-border: var(--rc-border, 1px solid ButtonBorder);
5
+ --rc-textarea-radius: var(--substrate-radius-lg, 0.75rem);
6
+ --rc-textarea-background: var(--rc-field, Field);
7
+ --rc-textarea-color: var(--rc-field-text, FieldText);
8
+ font-family: var(--rc-font-family, inherit);
9
+ }
10
+
11
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-textarea::part(root) {
12
+ transition:
13
+ border-color var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease),
14
+ box-shadow var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
15
+ }
16
+
17
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-textarea::part(root):focus-within {
18
+ box-shadow: 0 0 0 4px color-mix(in srgb, var(--rc-accent, Highlight) 16%, transparent);
19
+ }
20
+ }
@@ -0,0 +1,31 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-toolbar {
3
+ display: inline-block;
4
+ }
5
+
6
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-toolbar::part(root) {
7
+ gap: 0.125rem;
8
+ }
9
+
10
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-toolbar > button {
11
+ display: inline-flex;
12
+ align-items: center;
13
+ justify-content: center;
14
+ border-radius: var(--substrate-radius-md, 0.5rem);
15
+ line-height: 1;
16
+ transition:
17
+ background-color var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease),
18
+ color var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
19
+ }
20
+
21
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-toolbar > button:hover {
22
+ background: color-mix(in srgb, var(--rc-accent, Highlight) 10%, transparent);
23
+ }
24
+
25
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
26
+ rc-toolbar
27
+ > button[aria-pressed='true'] {
28
+ background: var(--rc-highlight, Highlight);
29
+ color: var(--rc-highlight-text, HighlightText);
30
+ }
31
+ }
@@ -0,0 +1,30 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-transfer-list {
3
+ --rc-transfer-list-gap: 1rem;
4
+ --rc-transfer-list-panel-border: var(--rc-border, 1px solid ButtonBorder);
5
+ --rc-transfer-list-panel-radius: var(--substrate-radius-lg, 0.75rem);
6
+ --rc-transfer-list-panel-background: var(--substrate-surface-raised, Canvas);
7
+ }
8
+
9
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-transfer-list::part(panel),
10
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-transfer-list::part(listbox) {
11
+ box-shadow: var(--substrate-shadow-sm, none);
12
+ }
13
+
14
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-transfer-list::part(listbox) {
15
+ --rc-listbox-option-gap: var(--substrate-item-gap, 0.5rem);
16
+ --rc-listbox-option-min-block-size: 2.25rem;
17
+ --rc-listbox-option-padding-block: var(--substrate-item-padding-block, 0.55rem);
18
+ --rc-listbox-option-padding-inline: var(--substrate-item-padding-inline, 0.75rem);
19
+ --rc-listbox-hover-bg: color-mix(in srgb, var(--rc-accent, Highlight) 10%, transparent);
20
+ --rc-listbox-hover-color: var(--rc-field-text, FieldText);
21
+ --rc-listbox-active-bg: color-mix(in srgb, var(--rc-accent, Highlight) 16%, transparent);
22
+ --rc-listbox-active-color: var(--rc-field-text, FieldText);
23
+ --rc-listbox-selected-bg: var(--rc-highlight, Highlight);
24
+ --rc-listbox-selected-color: var(--rc-highlight-text, HighlightText);
25
+ }
26
+
27
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-transfer-list::part(button) {
28
+ border-radius: var(--rc-control-radius, 0.5rem);
29
+ }
30
+ }
@@ -0,0 +1,8 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-virtual-canvas {
3
+ overflow: hidden;
4
+ border: var(--rc-border, 1px solid ButtonBorder);
5
+ border-radius: var(--substrate-radius-lg, 0.75rem);
6
+ background: var(--substrate-surface, Canvas);
7
+ }
8
+ }
package/components.css ADDED
@@ -0,0 +1,23 @@
1
+ @layer rc-theme-substrate.defaults, rc-theme-substrate.bridge, rc-theme-substrate.components;
2
+
3
+ @import './components/listbox.css';
4
+ @import './components/select.css';
5
+ @import './components/combobox.css';
6
+ @import './components/search-bar.css';
7
+ @import './components/textarea.css';
8
+ @import './components/markdown-editor.css';
9
+ @import './components/transfer-list.css';
10
+ @import './components/fab.css';
11
+ @import './components/app-bar.css';
12
+ @import './components/menu.css';
13
+ @import './components/menu-button.css';
14
+ @import './components/menubar.css';
15
+ @import './components/toolbar.css';
16
+ @import './components/slider.css';
17
+ @import './components/range-slider.css';
18
+ @import './components/splitter.css';
19
+ @import './components/dialog.css';
20
+ @import './components/disclosure.css';
21
+ @import './components/accordion.css';
22
+ @import './components/virtual-canvas.css';
23
+ @import './components/modes.css';
package/defaults.css ADDED
@@ -0,0 +1,79 @@
1
+ @layer rc-theme-substrate.defaults, rc-theme-substrate.bridge, rc-theme-substrate.components;
2
+
3
+ @layer rc-theme-substrate.defaults {
4
+ /*
5
+ * Substrate reference tokens.
6
+ *
7
+ * These defaults are scoped so applications can place the theme at any app
8
+ * boundary. Import bridge.css alone when providing your own --substrate-* tokens.
9
+ */
10
+ .rc-theme-substrate,
11
+ :host(.rc-theme-substrate) {
12
+ color-scheme: light dark;
13
+
14
+ --substrate-primary: light-dark(oklch(57% 0.19 48), oklch(76% 0.15 58));
15
+ --substrate-on-primary: light-dark(oklch(99% 0.01 80), oklch(19% 0.04 45));
16
+ --substrate-primary-container: light-dark(oklch(94% 0.06 62), oklch(31% 0.08 48));
17
+ --substrate-on-primary-container: light-dark(oklch(27% 0.08 45), oklch(95% 0.05 66));
18
+
19
+ --substrate-surface: light-dark(oklch(99% 0.006 80), oklch(18% 0.012 72));
20
+ --substrate-surface-raised: light-dark(oklch(97% 0.012 78), oklch(23% 0.016 72));
21
+ --substrate-field: light-dark(oklch(100% 0 0), oklch(20% 0.014 72));
22
+ --substrate-on-surface: light-dark(oklch(19% 0.018 72), oklch(94% 0.01 80));
23
+ --substrate-on-surface-muted: light-dark(oklch(46% 0.018 72), oklch(73% 0.014 80));
24
+ --substrate-border-color: light-dark(oklch(83% 0.018 75), oklch(39% 0.018 72));
25
+ --substrate-shadow-color: light-dark(oklch(16% 0.03 60 / 18%), oklch(0% 0 0 / 42%));
26
+
27
+ --substrate-font-family:
28
+ Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
29
+ --substrate-font-size: 0.95rem;
30
+ --substrate-line-height: 1.45;
31
+ --substrate-font-weight: 450;
32
+
33
+ --substrate-radius-sm: 0.25rem;
34
+ --substrate-radius-md: 0.5rem;
35
+ --substrate-radius-lg: 0.75rem;
36
+ --substrate-radius-xl: 1rem;
37
+
38
+ --substrate-control-block-size: 2.5rem;
39
+ --substrate-control-padding-block: 0.5rem;
40
+ --substrate-control-padding-inline: 0.75rem;
41
+ --substrate-control-gap: 0.5rem;
42
+ --substrate-item-padding-block: 0.55rem;
43
+ --substrate-item-padding-inline: 0.75rem;
44
+ --substrate-item-gap: 0.5rem;
45
+
46
+ --substrate-shadow-sm: 0 1px 2px var(--substrate-shadow-color);
47
+ --substrate-shadow-md:
48
+ 0 1px 2px var(--substrate-shadow-color), 0 10px 30px
49
+ color-mix(in oklch, var(--substrate-shadow-color) 65%, transparent);
50
+ --substrate-shadow-lg:
51
+ 0 1px 2px var(--substrate-shadow-color), 0 18px 48px
52
+ color-mix(in oklch, var(--substrate-shadow-color) 80%, transparent);
53
+
54
+ --substrate-focus-ring: 2px solid var(--substrate-primary);
55
+ --substrate-focus-ring-offset: 2px;
56
+ --substrate-motion-duration: 160ms;
57
+ --substrate-motion-duration-slow: 240ms;
58
+ --substrate-motion-easing: cubic-bezier(0.2, 0, 0, 1);
59
+ --substrate-disabled-opacity: 0.52;
60
+ }
61
+
62
+ @media (forced-colors: active) {
63
+ .rc-theme-substrate,
64
+ :host(.rc-theme-substrate) {
65
+ --substrate-primary: Highlight;
66
+ --substrate-on-primary: HighlightText;
67
+ --substrate-primary-container: Highlight;
68
+ --substrate-on-primary-container: HighlightText;
69
+ --substrate-surface: Canvas;
70
+ --substrate-surface-raised: Canvas;
71
+ --substrate-field: Field;
72
+ --substrate-on-surface: CanvasText;
73
+ --substrate-on-surface-muted: GrayText;
74
+ --substrate-border-color: ButtonBorder;
75
+ --substrate-shadow-color: transparent;
76
+ --substrate-focus-ring: 2px solid Highlight;
77
+ }
78
+ }
79
+ }
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@rcarls/rc-theme-substrate",
3
+ "publishConfig": {
4
+ "access": "public"
5
+ },
6
+ "version": "0.3.0",
7
+ "description": "Lightweight CSS reference theme for app-oriented rc-webcomponents layouts.",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/richardcarls/rc-webcomponents.git",
11
+ "directory": "packages/rc-theme-substrate"
12
+ },
13
+ "homepage": "https://richardcarls.github.io/rc-webcomponents/guide/theme-previews",
14
+ "license": "MIT",
15
+ "type": "module",
16
+ "sideEffects": [
17
+ "*.css"
18
+ ],
19
+ "exports": {
20
+ ".": "./bridge.css",
21
+ "./bridge.css": "./bridge.css",
22
+ "./defaults.css": "./defaults.css",
23
+ "./components.css": "./components.css",
24
+ "./components/*.css": "./components/*.css",
25
+ "./theme.css": "./theme.css"
26
+ },
27
+ "files": [
28
+ "*.css",
29
+ "components",
30
+ "README.md"
31
+ ],
32
+ "scripts": {
33
+ "build": "echo 'CSS-only package, no build step'",
34
+ "test:browser": "vitest --run",
35
+ "test:browser:chrome": "vitest --run --project=chromium",
36
+ "test:browser:firefox": "vitest --run --project=firefox"
37
+ },
38
+ "devDependencies": {
39
+ "@vitest/browser-playwright": "4.1.5",
40
+ "playwright": "^1.56.0",
41
+ "vite": "^7.1.7",
42
+ "vitest": "^4.0.6"
43
+ }
44
+ }
package/theme.css ADDED
@@ -0,0 +1,3 @@
1
+ @import './defaults.css';
2
+ @import './bridge.css';
3
+ @import './components.css';