@rcarls/rc-theme-tailwind 0.0.0-next-20261103014840

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.
Files changed (64) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +127 -0
  3. package/bridge.css +245 -0
  4. package/components/accordion.css +18 -0
  5. package/components/adaptive-menu.css +98 -0
  6. package/components/app-bar.css +21 -0
  7. package/components/bottom-sheet.css +90 -0
  8. package/components/breadcrumbs.css +38 -0
  9. package/components/button.css +44 -0
  10. package/components/card.css +51 -0
  11. package/components/carousel.css +31 -0
  12. package/components/chip-group.css +21 -0
  13. package/components/chip.css +20 -0
  14. package/components/combobox.css +55 -0
  15. package/components/data-table.css +55 -0
  16. package/components/dialog.css +39 -0
  17. package/components/disclosure.css +112 -0
  18. package/components/fab-menu.css +36 -0
  19. package/components/fab.css +44 -0
  20. package/components/field.css +154 -0
  21. package/components/icons.css +19 -0
  22. package/components/list-item.css +70 -0
  23. package/components/listbox.css +29 -0
  24. package/components/markdown-editor.css +53 -0
  25. package/components/menu-button.css +18 -0
  26. package/components/menu.css +28 -0
  27. package/components/menubar.css +17 -0
  28. package/components/modes.css +60 -0
  29. package/components/navigation-bar.css +43 -0
  30. package/components/navigation-rail.css +72 -0
  31. package/components/page-turner.css +19 -0
  32. package/components/pagination.css +50 -0
  33. package/components/popover.css +13 -0
  34. package/components/progress.css +11 -0
  35. package/components/range-slider.css +18 -0
  36. package/components/scroller.css +19 -0
  37. package/components/search-bar.css +30 -0
  38. package/components/segmented-button.css +19 -0
  39. package/components/select.css +74 -0
  40. package/components/slider.css +10 -0
  41. package/components/snackbar.css +23 -0
  42. package/components/splitter.css +39 -0
  43. package/components/switch.css +28 -0
  44. package/components/textarea.css +21 -0
  45. package/components/toolbar.css +36 -0
  46. package/components/tooltip.css +15 -0
  47. package/components/transfer-list.css +30 -0
  48. package/components/virtual-canvas.css +18 -0
  49. package/components/virtual-scroller.css +7 -0
  50. package/components.css +49 -0
  51. package/css-components/button.css +66 -0
  52. package/css-components/card.css +14 -0
  53. package/css-components/chip-group.css +9 -0
  54. package/css-components/chip.css +80 -0
  55. package/css-components/disclosure.css +25 -0
  56. package/css-components/list.css +34 -0
  57. package/css-components/select.css +20 -0
  58. package/css-components/textarea.css +22 -0
  59. package/css-components.css +31 -0
  60. package/defaults.css +137 -0
  61. package/layers.css +10 -0
  62. package/native.css +249 -0
  63. package/package.json +49 -0
  64. package/theme.css +3 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,36 @@
1
+ # @rcarls/rc-theme-tailwind
2
+
3
+ ## 0.0.0-next-20261103014840
4
+
5
+ ### Minor Changes
6
+
7
+ - 81d4824: Adds `rc-breadcrumbs`, a breadcrumb trail enhancer for a native `<nav>` and ordered list of
8
+ links that follows the WAI-ARIA Breadcrumb pattern. It names an unlabeled landmark in the
9
+ element's language, draws separators that assistive technology skips, and moves
10
+ `aria-current="page"` to the link matching `current-href` after client-side navigation.
11
+ The aggregate, the React wrappers, and all four themes cover it.
12
+ - 4db22ea: Adds `rc-data-table`, a sortable-header enhancer for a native `<table>` that follows the
13
+ WAI-ARIA sortable table example. Authored `<button>` or link controls in
14
+ `<th data-rc-sort-key>` headers request a sort; the element reflects it as `aria-sort` on the
15
+ active header, draws a distinct indicator for each sort state, and fires a cancelable
16
+ `rc-data-table-sort` for the consumer to re-render the rows. It never sorts data itself. The
17
+ host becomes a focusable group named by the caption while the table overflows. The aggregate,
18
+ the React wrappers, and all four themes cover it.
19
+
20
+ `rc-pagination` now places its live region on the document body instead of inside the
21
+ element, so it never joins the consumer's markup.
22
+
23
+ - 34fa00a: Adds `rc-pagination`, a pagination enhancer for a native `<nav>` holding page links or
24
+ buttons tagged with `data-rc-page`. It keeps `aria-current="page"` on the current page, names
25
+ the landmark and numbered controls, disables steps past either end, and fires a cancelable
26
+ `rc-pagination-change` that can hand link navigation to a client-side router. The DOM-free
27
+ `paginationRange()` helper, also at `@rcarls/rc-pagination/range`, builds the page list on a
28
+ server. The aggregate, the React wrappers, and all four themes cover it.
29
+ - 0f3f55e: Add `@rcarls/rc-theme-tailwind`, a CSS-only Tailwind CSS v4 token bridge and
30
+ calm SaaS reference theme. It maps Tailwind color, typography, spacing,
31
+ radius, shadow, and easing variables to the public `--rc-*` semantic contract,
32
+ with optional native controls and CSS-only component recipes.
33
+ - f20279f: Adds `@rcarls/rc-theme-tailwind/layers.css`, a cascade layer order to import before Tailwind
34
+ and the theme. It keeps every `rc-*` layer above Tailwind's `base` layer, so Preflight resets
35
+ no longer override component structure (such as a modal dialog's centering), and below
36
+ `components` and `utilities`, so app classes still win.
package/README.md ADDED
@@ -0,0 +1,127 @@
1
+ # `@rcarls/rc-theme-tailwind`
2
+
3
+ Tailwind CSS v4 token bridge and calm SaaS reference theme for `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 CSS-only and has no Tailwind runtime dependency. The bridge consumes the
8
+ Tailwind v4 `--color-*`, `--font-*`, `--radius-*`, `--shadow-*`, and
9
+ `--ease-*` theme variables and maps them to the public `--rc-*` semantic
10
+ contract. Without Tailwind, it supplies calm SaaS defaults with a cyan accent
11
+ fallback, neutral surfaces, compact controls, system-color fallbacks, and
12
+ component polish rules.
13
+
14
+ ## Installation
15
+
16
+ ```sh
17
+ yarn add @rcarls/rc-theme-tailwind
18
+ ```
19
+
20
+ ## Full reference theme
21
+
22
+ Import the full theme bundle:
23
+
24
+ ```css
25
+ @import '@rcarls/rc-theme-tailwind/theme.css';
26
+ ```
27
+
28
+ Apply the theme class to your app shell or any subtree:
29
+
30
+ ```html
31
+ <main class="rc-theme-tailwind">
32
+ <rc-select>...</rc-select>
33
+ <rc-dialog>...</rc-dialog>
34
+ </main>
35
+ ```
36
+
37
+ ## Build your own theme from it
38
+
39
+ The bridge is token-first. Import it after your Tailwind v4 theme variables and
40
+ override the Tailwind tokens at your theme boundary:
41
+
42
+ ```css
43
+ @import '@rcarls/rc-theme-tailwind/bridge.css';
44
+ @import '@rcarls/rc-theme-tailwind/components.css';
45
+
46
+ .my-product-theme {
47
+ --color-cyan-600: oklch(58% 0.19 220);
48
+ --color-slate-950: oklch(20% 0.03 260);
49
+ --radius-lg: 0.75rem;
50
+ --font-sans: Inter, system-ui, sans-serif;
51
+ }
52
+ ```
53
+
54
+ ### Layer order with Tailwind
55
+
56
+ Cascade layers sort in the order they are first declared. Importing this theme
57
+ before Tailwind puts every `rc-*` layer below Tailwind's `base` layer, so
58
+ Preflight's resets (such as the universal `margin: 0` that undoes a modal
59
+ dialog's centering) override component structure. Importing it after Tailwind
60
+ puts the theme above Tailwind's utilities instead. Import `layers.css` first
61
+ so the `rc-*` layers sit after `base` and before `components` and `utilities`:
62
+
63
+ ```css
64
+ @import '@rcarls/rc-theme-tailwind/layers.css';
65
+ @import '@rcarls/rc-theme-tailwind/bridge.css';
66
+ @import '@rcarls/rc-theme-tailwind/components.css';
67
+ @import 'tailwindcss';
68
+ ```
69
+
70
+ Your own `@layer components` rules and utility classes still override the theme.
71
+
72
+ If your Tailwind theme uses a different palette, set the documented
73
+ `--color-*` tokens (or override the resulting `--rc-*` semantic tokens) at the
74
+ same boundary. No utility classes or Tailwind build step are required by this
75
+ package.
76
+
77
+ Selective component styles are exported for apps that want only part of the
78
+ reference layer:
79
+
80
+ ```css
81
+ @import '@rcarls/rc-theme-tailwind/bridge.css';
82
+ @import '@rcarls/rc-theme-tailwind/components/select.css';
83
+ @import '@rcarls/rc-theme-tailwind/components/dialog.css';
84
+ ```
85
+
86
+ Native HTML can opt into the same presentation without registering an RC
87
+ element. Import the defaults and bridge when needed, then opt into the native
88
+ layer and CSS-only recipes:
89
+
90
+ ```css
91
+ @import '@rcarls/rc-theme-tailwind/defaults.css';
92
+ @import '@rcarls/rc-theme-tailwind/bridge.css';
93
+ @import '@rcarls/rc-theme-tailwind/native.css';
94
+ @import '@rcarls/rc-theme-tailwind/css-components.css';
95
+ ```
96
+
97
+ `native.css` is an optional convenience layer for styling ordinary buttons,
98
+ text fields, selects, textareas, checkboxes, radios, ranges, and progress
99
+ controls throughout `.rc-theme-tailwind`. Component recipes style native
100
+ children when their presentation belongs to a themed menu, toolbar, or other
101
+ component context. Add `data-rc-native="off"` to an element to opt it and its
102
+ descendants out of the native layer. The
103
+ opt-in `css-components.css` recipes cover `.rc-button`, `.rc-chip`,
104
+ `.rc-chip-group`, `.rc-select`, `.rc-textarea`, `.rc-card`, `.rc-list`, and
105
+ `details.rc-disclosure`; each is also exported as
106
+ `css-components/<name>.css`. They provide appearance and CSS-visible states
107
+ only, not behavior, events, popup replacement, or measured overflow.
108
+
109
+ Tag general icon-font markup with `data-rc-icon`; component-specific markers
110
+ such as `data-rc-button-icon` and `data-rc-navigation-icon` opt in
111
+ automatically. The shared `--rc-icon-font-size` and
112
+ `--rc-icon-font-line-height` tokens keep glyph geometry consistent and can be
113
+ overridden at the theme boundary or on one component.
114
+
115
+ ## View transitions
116
+
117
+ The theme includes stable CSS hooks for apps that opt into View Transitions,
118
+ but it does not start transitions or require browser support:
119
+
120
+ ```css
121
+ .rc-theme-tailwind [data-rc-view-transition='panel'] {
122
+ --rc-view-transition-name: rc-panel;
123
+ }
124
+ ```
125
+
126
+ Application code remains responsible for deciding when to call
127
+ `document.startViewTransition()`.
package/bridge.css ADDED
@@ -0,0 +1,245 @@
1
+ @layer rc-base, rc-theme-tailwind.defaults, rc-theme-tailwind.bridge, rc-theme-tailwind.native, rc-theme-tailwind.components, rc-theme-tailwind.css-components,
2
+ rc-theme-tailwind.overrides;
3
+
4
+ @layer rc-theme-tailwind.bridge {
5
+ /*
6
+ * Maps Tailwind CSS v4 theme variables to the rc-webcomponents public
7
+ * styling contract. Import this file after the application's @theme block.
8
+ */
9
+ .rc-theme-tailwind,
10
+ :host(.rc-theme-tailwind) {
11
+ /* Internal recipe aliases keep every component stylesheet on the same
12
+ * Tailwind v4 source tokens, including bridge-only imports. */
13
+ --tailwind-primary: var(--color-cyan-600, #0891b2);
14
+ --tailwind-on-primary: var(--color-white, #fff);
15
+ --tailwind-primary-container: var(--color-cyan-100, #cffafe);
16
+ --tailwind-on-primary-container: var(--color-cyan-950, #083344);
17
+ --tailwind-surface: var(--color-slate-50, #f8fafc);
18
+ --tailwind-surface-raised: var(--color-white, #fff);
19
+ --tailwind-field: var(--color-white, #fff);
20
+ --tailwind-on-surface: var(--color-slate-950, #020617);
21
+ --tailwind-on-surface-muted: var(--color-slate-600, #475569);
22
+ --tailwind-border-color: var(--color-slate-200, #e2e8f0);
23
+ --tailwind-inverse-surface: var(--color-slate-900, #0f172a);
24
+ --tailwind-inverse-on-surface: var(--color-white, #fff);
25
+ --tailwind-error: var(--color-red-600, #dc2626);
26
+ --tailwind-font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
27
+ --tailwind-font-size: var(--text-sm, 0.875rem);
28
+ --tailwind-font-weight: var(--font-weight-normal, 400);
29
+ --tailwind-line-height: var(--leading-normal, 1.5);
30
+ --tailwind-radius-sm: var(--radius-sm, 0.25rem);
31
+ --tailwind-radius-md: var(--radius-md, 0.375rem);
32
+ --tailwind-radius-lg: var(--radius-lg, 0.5rem);
33
+ --tailwind-radius-xl: var(--radius-xl, 0.75rem);
34
+ --tailwind-radius-pill: var(--radius-full, 999px);
35
+ --tailwind-control-block-size: calc(var(--spacing, 0.25rem) * 10);
36
+ --tailwind-control-padding-block: calc(var(--spacing, 0.25rem) * 2);
37
+ --tailwind-control-padding-inline: calc(var(--spacing, 0.25rem) * 3);
38
+ --tailwind-control-gap: calc(var(--spacing, 0.25rem) * 2);
39
+ --tailwind-item-padding-block: calc(var(--spacing, 0.25rem) * 2.5);
40
+ --tailwind-item-padding-inline: calc(var(--spacing, 0.25rem) * 3);
41
+ --tailwind-item-gap: calc(var(--spacing, 0.25rem) * 2);
42
+ --tailwind-shadow-md: var(--shadow-md, 0 4px 6px -1px rgb(2 6 23 / 12%));
43
+ --tailwind-shadow-lg: var(--shadow-lg, 0 10px 15px -3px rgb(2 6 23 / 14%));
44
+ --tailwind-shadow-sm: var(--shadow-sm, 0 1px 2px 0 rgb(2 6 23 / 10%));
45
+ --tailwind-motion-easing: var(--ease-out, cubic-bezier(0.2, 0, 0, 1));
46
+ --tailwind-motion-duration-slow: 240ms;
47
+ --tailwind-motion-effects-duration-fast: 100ms;
48
+ --tailwind-motion-effects-duration-default: 160ms;
49
+ --tailwind-motion-effects-duration-slow: 240ms;
50
+ --tailwind-motion-spatial-duration-fast: 160ms;
51
+ --tailwind-motion-spatial-duration-default: 240ms;
52
+ --tailwind-motion-spatial-duration-slow: 320ms;
53
+ --tailwind-focus-ring: 2px solid var(--color-cyan-600, Highlight);
54
+ --tailwind-focus-ring-offset: 2px;
55
+ --tailwind-disabled-opacity: 0.5;
56
+ --rc-surface: var(--color-slate-50, Canvas);
57
+ --rc-field: var(--color-white, Field);
58
+ --rc-button-bg: var(--color-white, ButtonFace);
59
+ --rc-field-text: var(--color-slate-950, FieldText);
60
+ --rc-field-error-color: var(--color-red-600, red);
61
+ --rc-button-text: var(--color-slate-950, ButtonText);
62
+ --rc-highlight: var(--color-cyan-100, Highlight);
63
+ --rc-highlight-text: var(--color-cyan-950, HighlightText);
64
+ --rc-text-disabled: var(--color-slate-600, GrayText);
65
+ --rc-accent: var(--color-cyan-600, Highlight);
66
+ --rc-border-color: var(--color-slate-200, ButtonBorder);
67
+ --rc-border-width: 1px;
68
+ --rc-border-style: solid;
69
+ --rc-border: var(--rc-border-width) var(--rc-border-style) var(--rc-border-color);
70
+ --rc-shadow: var(--shadow-md, 0 2px 8px rgb(0 0 0 / 15%));
71
+ --rc-popup-background: var(--color-slate-50, Canvas);
72
+ --rc-popup-color: var(--rc-field-text, CanvasText);
73
+ --rc-popup-border: var(--rc-border);
74
+ --rc-popup-radius: var(--radius-lg, 0.75rem);
75
+ --rc-popup-shadow: var(--shadow-lg, none);
76
+ --rc-popup-padding-block: 0.375rem;
77
+ --rc-font-family: var(--font-sans, inherit);
78
+ --rc-font-size: var(--text-sm, 1em);
79
+ --rc-font-weight: var(--font-weight-normal, 400);
80
+ --rc-line-height: var(--leading-normal, normal);
81
+ --rc-icon-font-size: 1.5rem;
82
+ --rc-icon-font-line-height: var(--rc-icon-font-size);
83
+ --rc-control-block-size: calc(var(--spacing, 0.25rem) * 10);
84
+ --rc-control-padding-block: calc(var(--spacing, 0.25rem) * 2);
85
+ --rc-control-padding-inline: calc(var(--spacing, 0.25rem) * 3);
86
+ --rc-control-gap: calc(var(--spacing, 0.25rem) * 2);
87
+ --rc-button-color: var(--rc-button-text, ButtonText);
88
+ --rc-button-block-size: var(--rc-control-block-size);
89
+ --rc-button-radius: var(--rc-control-radius);
90
+ --rc-button-border: var(--rc-border);
91
+ --rc-button-padding-block: var(--rc-control-padding-block);
92
+ --rc-button-padding-inline: var(--rc-control-padding-inline);
93
+ --rc-button-gap: var(--rc-control-gap);
94
+ --rc-button-font: var(--rc-font-weight) var(--rc-font-size) / var(--rc-line-height)
95
+ var(--rc-font-family);
96
+ --rc-button-hover-state-layer-opacity: 0.08;
97
+ --rc-button-focus-state-layer-opacity: 0.12;
98
+ --rc-button-pressed-state-layer-opacity: 0.12;
99
+ --rc-card-bg: var(--color-white, Canvas);
100
+ --rc-card-color: var(--color-slate-950, CanvasText);
101
+ --rc-card-radius: var(--radius-lg, 0.75rem);
102
+ --rc-card-padding-block: 0.75rem;
103
+ --rc-card-padding-inline: 0.75rem;
104
+ --rc-card-actions-gap: 0.5rem;
105
+ --rc-card-subtitle-color: color-mix(in srgb, currentColor 72%, transparent);
106
+ --rc-card-hover-state-layer-opacity: 0.08;
107
+ --rc-card-pressed-state-layer-opacity: 0.12;
108
+ --rc-chip-block-size: 2rem;
109
+ --rc-chip-gap: 0px;
110
+ --rc-chip-padding-inline: 0.75rem;
111
+ --rc-chip-border: var(--rc-border);
112
+ --rc-chip-radius: var(--radius-md, 0.5rem);
113
+ --rc-chip-bg: var(--color-white, ButtonFace);
114
+ --rc-chip-color: var(--color-slate-950, ButtonText);
115
+ --rc-chip-font: inherit;
116
+ --rc-chip-text-decoration: none;
117
+ --rc-chip-selected-bg: var(--rc-highlight, Highlight);
118
+ --rc-switch-native-appearance: none;
119
+ --rc-switch-native-inline-size: 100%;
120
+ --rc-switch-native-block-size: 100%;
121
+ --rc-switch-native-margin: 0;
122
+ --rc-switch-native-opacity: 0;
123
+ --rc-switch-decoration-display: block;
124
+ --rc-switch-icon-display: grid;
125
+ --rc-switch-track-inline-size: 3.25rem;
126
+ --rc-switch-track-block-size: 2rem;
127
+ --rc-switch-selected-track-bg: var(--rc-accent);
128
+ --rc-switch-thumb-translate: 1.125rem;
129
+ --rc-segmented-button-segment-min-block-size: var(--rc-control-block-size);
130
+ --rc-segmented-button-selected-bg: var(--rc-highlight, Highlight);
131
+ --rc-snackbar-bg: var(--color-slate-900, CanvasText);
132
+ --rc-snackbar-color: var(--color-white, Canvas);
133
+ --rc-snackbar-border: 0;
134
+ --rc-snackbar-action-color: var(--color-white, Canvas);
135
+ --rc-snackbar-action-border: 0;
136
+ --rc-snackbar-action-radius: 9999px;
137
+ --rc-snackbar-action-padding-block: 0.5rem;
138
+ --rc-snackbar-action-padding-inline: 0.75rem;
139
+ --rc-snackbar-action-bg: transparent;
140
+ --rc-snackbar-action-font: 650 0.875rem / 1.25 var(--rc-font-family, inherit);
141
+ --rc-item-padding-block: calc(var(--spacing, 0.25rem) * 2.5);
142
+ --rc-item-padding-inline: calc(var(--spacing, 0.25rem) * 3);
143
+ --rc-item-gap: calc(var(--spacing, 0.25rem) * 2);
144
+ --rc-list-item-gap: var(--rc-item-gap);
145
+ --rc-list-item-min-block-size: 2.25rem;
146
+ --rc-list-item-padding-block: var(--rc-item-padding-block);
147
+ --rc-list-item-padding-inline: var(--rc-item-padding-inline);
148
+ --rc-list-item-selected-bg: var(--rc-highlight, Highlight);
149
+ --rc-list-item-selected-color: var(--rc-highlight-text, HighlightText);
150
+ --rc-radius-sm: var(--radius-sm, 0.25rem);
151
+ --rc-radius-md: var(--radius-md, 0.5rem);
152
+ --rc-control-radius: var(--radius-md, 0.5rem);
153
+ --rc-focus-ring: 2px solid var(--color-cyan-600, Highlight);
154
+ --rc-focus-ring-offset: 2px;
155
+ --rc-disabled-opacity: 0.5;
156
+ --rc-motion-effects-duration-fast: 100ms;
157
+ --rc-motion-effects-easing-fast: ease-out;
158
+ --rc-motion-effects-duration-default: 160ms;
159
+ --rc-motion-effects-easing-default: var(--rc-motion-effects-easing-fast);
160
+ --rc-motion-effects-duration-slow: 240ms;
161
+ --rc-motion-effects-easing-slow: var(--rc-motion-effects-easing-fast);
162
+ --rc-motion-spatial-duration-fast: 160ms;
163
+ --rc-motion-spatial-easing-fast: var(--ease-out, cubic-bezier(0.2, 0, 0, 1));
164
+ --rc-motion-spatial-duration-default: 240ms;
165
+ --rc-motion-spatial-easing-default: var(--rc-motion-spatial-easing-fast);
166
+ --rc-motion-spatial-duration-slow: 320ms;
167
+ --rc-motion-spatial-easing-slow: var(--rc-motion-spatial-easing-fast);
168
+ /* Tailwind's one curve is decelerate-shaped, so it is the enter curve. */
169
+ --rc-motion-effects-easing-enter: ease-out;
170
+ --rc-motion-effects-easing-exit: ease-in;
171
+ --rc-motion-spatial-easing-enter: var(--rc-motion-spatial-easing-fast);
172
+ --rc-motion-spatial-easing-exit: cubic-bezier(0.3, 0, 1, 1);
173
+ /* Matches base.css: the compatibility token follows the effects default. */
174
+ --rc-motion-duration: var(--rc-motion-effects-duration-default);
175
+ /*
176
+ * Mixed against the theme's own inverse surface rather than `CanvasText`,
177
+ * so the scrim carries the palette's warmth and resolves to a real color
178
+ * rather than to a system one that cannot leave CSS.
179
+ */
180
+ --rc-dialog-scrim: color-mix(in srgb, var(--color-slate-900, CanvasText) 42%, transparent);
181
+ }
182
+
183
+ .rc-theme-tailwind rc-listbox,
184
+ :host(.rc-theme-tailwind) rc-listbox,
185
+ .rc-theme-tailwind rc-menu,
186
+ :host(.rc-theme-tailwind) rc-menu {
187
+ --rc-listbox-option-gap: var(--rc-list-item-gap, 0.5rem);
188
+ --rc-listbox-option-min-block-size: var(--rc-list-item-min-block-size, 2.25rem);
189
+ --rc-listbox-option-padding-block: var(--rc-list-item-padding-block, 0.55rem);
190
+ --rc-listbox-option-padding-inline: var(--rc-list-item-padding-inline, 0.75rem);
191
+ --rc-listbox-hover-bg: color-mix(in srgb, var(--rc-accent, Highlight) 10%, transparent);
192
+ --rc-listbox-hover-color: var(--rc-field-text, FieldText);
193
+ --rc-listbox-active-bg: color-mix(in srgb, var(--rc-accent, Highlight) 16%, transparent);
194
+ --rc-listbox-active-color: var(--rc-field-text, FieldText);
195
+ --rc-listbox-selected-bg: var(--rc-list-item-selected-bg, Highlight);
196
+ --rc-listbox-selected-color: var(--rc-list-item-selected-color, HighlightText);
197
+ }
198
+
199
+ .rc-theme-tailwind rc-select,
200
+ :host(.rc-theme-tailwind) rc-select,
201
+ .rc-theme-tailwind rc-combobox,
202
+ :host(.rc-theme-tailwind) rc-combobox {
203
+ --rc-select-control-block-size: var(--rc-control-block-size);
204
+ --rc-select-radius: var(--rc-control-radius);
205
+ --rc-select-chip-radius: var(--radius-sm, 0.25rem);
206
+ --rc-combobox-control-block-size: var(--rc-control-block-size);
207
+ --rc-combobox-radius: var(--rc-control-radius);
208
+ --rc-combobox-chip-radius: var(--radius-sm, 0.25rem);
209
+ }
210
+
211
+ .rc-theme-tailwind rc-slider,
212
+ :host(.rc-theme-tailwind) rc-slider,
213
+ .rc-theme-tailwind rc-range-slider,
214
+ :host(.rc-theme-tailwind) rc-range-slider {
215
+ --rc-slider-track-size: 0.375rem;
216
+ --rc-slider-track-background: color-mix(in srgb, var(--rc-border-color) 70%, transparent);
217
+ --rc-slider-progress-background: var(--rc-accent);
218
+ --rc-slider-track-radius: 999px;
219
+ --rc-range-slider-accent: var(--rc-accent);
220
+ --rc-range-slider-track-background: color-mix(in srgb, var(--rc-border-color) 70%, transparent);
221
+ --rc-range-slider-thumb-background: var(--color-slate-50, Canvas);
222
+ --rc-range-slider-thumb-border: var(--rc-accent);
223
+ --rc-thumb-radius: 0.5625rem;
224
+ }
225
+
226
+ .rc-theme-tailwind rc-progress,
227
+ :host(.rc-theme-tailwind) rc-progress {
228
+ --rc-progress-track-background: color-mix(in srgb, var(--rc-border-color) 70%, transparent);
229
+ --rc-progress-track-opacity: 1;
230
+ --rc-progress-track-radius: 999px;
231
+ --rc-progress-fill-background: var(--rc-accent);
232
+ --rc-progress-value-color: var(--color-slate-600, GrayText);
233
+ }
234
+
235
+ .rc-theme-tailwind rc-bottom-sheet,
236
+ :host(.rc-theme-tailwind) rc-bottom-sheet {
237
+ --rc-bottom-sheet-bg: var(--color-white, Canvas);
238
+ --rc-bottom-sheet-color: var(--rc-field-text, CanvasText);
239
+ --rc-bottom-sheet-radius: var(--radius-xl, 1rem) var(--radius-xl, 1rem) 0 0;
240
+ --rc-bottom-sheet-shadow: var(--shadow-lg, none);
241
+ --rc-bottom-sheet-scrim: var(--rc-dialog-scrim);
242
+ --rc-bottom-sheet-handle-color: var(--rc-border-color, GrayText);
243
+ --rc-bottom-sheet-handle-radius: var(--radius-full, 999px);
244
+ }
245
+ }
@@ -0,0 +1,18 @@
1
+ @layer rc-theme-tailwind.components {
2
+ /*
3
+ * Only the group box. Panels inside an accordion take the same
4
+ * `--rc-disclosure-*` mapping as a standalone disclosure, which disclosure.css
5
+ * sets for `rc-accordion` as well, so the panel recipe is not repeated here.
6
+ */
7
+ :where(.rc-theme-tailwind, :host(.rc-theme-tailwind)) rc-accordion {
8
+ --rc-accordion-gap: 0.5rem;
9
+
10
+ /* Laid out before the element upgrades; see disclosure.css. */
11
+ display: grid;
12
+ gap: var(--rc-accordion-gap, 0.5rem);
13
+ }
14
+
15
+ :where(.rc-theme-tailwind, :host(.rc-theme-tailwind)) rc-accordion > rc-disclosure {
16
+ display: block;
17
+ }
18
+ }
@@ -0,0 +1,98 @@
1
+ @layer rc-theme-tailwind.components {
2
+ /*
3
+ * Declared on the theme root rather than on rc-adaptive-menu so menus
4
+ * rendered inside other shadow roots inherit the same values.
5
+ */
6
+ :where(.rc-theme-tailwind, :host(.rc-theme-tailwind)) {
7
+ --rc-adaptive-menu-gap: var(--tailwind-control-gap, 0.5rem);
8
+ --rc-adaptive-menu-icon-size: 1.25rem;
9
+
10
+ --rc-adaptive-menu-trigger-background: transparent;
11
+ --rc-adaptive-menu-trigger-border: 0;
12
+ --rc-adaptive-menu-trigger-color: var(--tailwind-on-surface-muted, ButtonText);
13
+ --rc-adaptive-menu-trigger-block-size: 2.25rem;
14
+ --rc-adaptive-menu-trigger-inline-size: 2.25rem;
15
+ --rc-adaptive-menu-trigger-padding: 0.375rem;
16
+ --rc-adaptive-menu-trigger-radius: var(--tailwind-radius-md, 0.5rem);
17
+ --rc-adaptive-menu-trigger-hover-background: color-mix(
18
+ in srgb,
19
+ var(--rc-accent, Highlight) 10%,
20
+ var(--tailwind-surface, Canvas)
21
+ );
22
+
23
+ /*
24
+ * The trigger is drawn at 2.25rem for density, so the hit area is inflated
25
+ * separately to clear the 3rem touch minimum without widening the row.
26
+ */
27
+ --rc-adaptive-menu-touch-target-block-size: 3rem;
28
+ --rc-adaptive-menu-touch-target-inline-size: 3rem;
29
+ --rc-adaptive-menu-touch-target-overlap-inline-end: 0.375rem;
30
+
31
+ --rc-adaptive-menu-popup-min-inline-size: 12rem;
32
+
33
+ /*
34
+ * The sheet presentation exists because a finger is doing the pointing, so
35
+ * its rows take the larger list item height rather than the menu row height.
36
+ */
37
+ --rc-adaptive-menu-item-min-block-size: 3rem;
38
+ --rc-adaptive-menu-item-padding-block: var(--tailwind-item-padding-block, 0.55rem);
39
+ --rc-adaptive-menu-item-padding-inline: var(--tailwind-item-padding-inline, 0.75rem);
40
+ --rc-adaptive-menu-item-gap: var(--tailwind-item-gap, 0.5rem);
41
+ }
42
+ }
43
+
44
+ /*
45
+ * An action rc-adaptive-menu moves into its overflow renders as a menu row.
46
+ * rc-adaptive-menu maps the action's own tokens onto its item tokens in rc-base,
47
+ * which sits below every theme layer, so this layer repeats the mapping above the
48
+ * theme's button and menu-button variants (filled, tonal, icon-only sizes, and so
49
+ * on) that would otherwise restyle the row as a standalone control.
50
+ */
51
+ @layer rc-theme-tailwind.overrides {
52
+ :where(.rc-theme-tailwind, :host(.rc-theme-tailwind))
53
+ rc-adaptive-menu
54
+ > rc-button[data-rc-action-overflowed] {
55
+ --rc-button-block-size: var(--rc-adaptive-menu-item-min-block-size, 2.5em);
56
+ --rc-button-icon-size: 100%;
57
+ --rc-button-touch-target-inline-size: 100%;
58
+ --rc-button-touch-target-block-size: var(--rc-adaptive-menu-item-min-block-size, 2.5em);
59
+ --rc-button-padding-inline: var(
60
+ --rc-adaptive-menu-item-padding-inline,
61
+ var(--rc-item-padding-inline, 0.75em)
62
+ );
63
+ --rc-button-padding-block: var(
64
+ --rc-adaptive-menu-item-padding-block,
65
+ var(--rc-item-padding-block, 0.3em)
66
+ );
67
+ --rc-button-radius: 0;
68
+ --rc-button-bg: transparent;
69
+ --rc-button-color: currentColor;
70
+ --rc-button-border: 0;
71
+ --rc-button-state-layer-bg: currentColor;
72
+ --rc-button-progress-color: currentColor;
73
+ }
74
+
75
+ :where(.rc-theme-tailwind, :host(.rc-theme-tailwind))
76
+ rc-adaptive-menu
77
+ > rc-menu-button[data-rc-action-overflowed] {
78
+ --rc-menu-button-trigger-block-size: var(--rc-adaptive-menu-item-min-block-size, 2.5em);
79
+ --rc-menu-button-icon-size: 100%;
80
+ --rc-menu-button-touch-target-inline-size: 100%;
81
+ --rc-menu-button-touch-target-block-size: var(--rc-adaptive-menu-item-min-block-size, 2.5em);
82
+ --rc-menu-button-trigger-padding-block: var(
83
+ --rc-adaptive-menu-item-padding-block,
84
+ var(--rc-item-padding-block, 0.3em)
85
+ );
86
+ --rc-menu-button-trigger-padding-inline: var(
87
+ --rc-adaptive-menu-item-padding-inline,
88
+ var(--rc-item-padding-inline, 0.75em)
89
+ );
90
+ --rc-menu-button-trigger-gap: var(--rc-adaptive-menu-item-gap, var(--rc-item-gap, 0.5em));
91
+ --rc-menu-button-trigger-radius: 0;
92
+ --rc-menu-button-trigger-border: 0;
93
+ --rc-menu-button-trigger-background: transparent;
94
+ --rc-menu-button-trigger-color: currentColor;
95
+ --rc-menu-button-trigger-hover-color: currentColor;
96
+ --rc-menu-button-trigger-open-color: currentColor;
97
+ }
98
+ }
@@ -0,0 +1,21 @@
1
+ @layer rc-theme-tailwind.components {
2
+ :where(.rc-theme-tailwind, :host(.rc-theme-tailwind)) rc-app-bar {
3
+ --rc-app-bar-bg: color-mix(in srgb, var(--tailwind-surface, Canvas) 88%, transparent);
4
+ --rc-app-bar-color: var(--rc-field-text, CanvasText);
5
+ --rc-app-bar-scroll-divider: var(--rc-border, 1px solid ButtonBorder);
6
+ --rc-app-bar-shadow: none;
7
+ -webkit-backdrop-filter: blur(16px);
8
+ backdrop-filter: blur(16px);
9
+ font-family: var(--rc-font-family, inherit);
10
+ position: relative;
11
+ z-index: var(--rc-app-bar-z-index, 1);
12
+ }
13
+
14
+ :where(.rc-theme-tailwind, :host(.rc-theme-tailwind)) rc-app-bar[data-scrolled] {
15
+ --rc-app-bar-shadow: var(--tailwind-shadow-sm, none);
16
+ }
17
+
18
+ :where(.rc-theme-tailwind, :host(.rc-theme-tailwind)) rc-app-bar :is(button, [role='button']) {
19
+ border-radius: var(--tailwind-radius-md, 0.5rem);
20
+ }
21
+ }
@@ -0,0 +1,90 @@
1
+ @layer rc-theme-tailwind.components {
2
+ :where(.rc-theme-tailwind, :host(.rc-theme-tailwind)) rc-bottom-sheet {
3
+ --rc-bottom-sheet-bg: var(--tailwind-surface-raised, Canvas);
4
+ --rc-bottom-sheet-handle-color: var(--rc-border-color, GrayText);
5
+ --rc-bottom-sheet-handle-radius: var(--tailwind-radius-pill, 999px);
6
+ }
7
+
8
+ :where(.rc-theme-tailwind, :host(.rc-theme-tailwind)) rc-bottom-sheet > dialog {
9
+ position: fixed;
10
+ inset: auto 0 0;
11
+ box-sizing: border-box;
12
+ inline-size: 100%;
13
+ max-inline-size: var(--rc-bottom-sheet-max-inline-size, 40rem);
14
+ max-block-size: var(--rc-bottom-sheet-max-block-size, 70dvh);
15
+ margin-block: 0;
16
+ margin-inline: auto;
17
+ padding: var(--rc-bottom-sheet-padding, 0 1rem calc(1rem + env(safe-area-inset-bottom, 0px)));
18
+ overflow: auto;
19
+ border: var(--rc-border, 1px solid ButtonBorder);
20
+ border-block-end: 0;
21
+ border-radius: var(--rc-bottom-sheet-radius, 1rem 1rem 0 0);
22
+ background: var(--rc-bottom-sheet-bg, var(--tailwind-surface-raised, Canvas));
23
+ color: var(--rc-bottom-sheet-color, var(--rc-field-text, CanvasText));
24
+ box-shadow: var(--rc-bottom-sheet-shadow, var(--tailwind-shadow-lg, none));
25
+ }
26
+
27
+ :where(.rc-theme-tailwind, :host(.rc-theme-tailwind)) rc-bottom-sheet > dialog::backdrop {
28
+ background: var(
29
+ --rc-bottom-sheet-scrim,
30
+ var(--rc-dialog-scrim, color-mix(in srgb, CanvasText 32%, transparent))
31
+ );
32
+ }
33
+
34
+ :where(.rc-theme-tailwind, :host(.rc-theme-tailwind))
35
+ rc-bottom-sheet
36
+ > dialog
37
+ [data-rc-bottom-sheet-handle] {
38
+ position: relative;
39
+ display: block;
40
+ inline-size: var(--rc-bottom-sheet-handle-target-inline-size, 100%);
41
+ min-block-size: var(--rc-bottom-sheet-handle-target-block-size, 3rem);
42
+ margin: var(--rc-bottom-sheet-handle-target-margin, 0);
43
+ padding: 0;
44
+ border: 0;
45
+ border-radius: inherit;
46
+ background: transparent;
47
+ appearance: none;
48
+ cursor: ns-resize;
49
+ touch-action: none;
50
+ }
51
+
52
+ :where(.rc-theme-tailwind, :host(.rc-theme-tailwind))
53
+ rc-bottom-sheet
54
+ > dialog
55
+ [data-rc-bottom-sheet-handle]::before {
56
+ content: '';
57
+ position: absolute;
58
+ inset-block-start: var(--rc-bottom-sheet-handle-offset, 50%);
59
+ inset-inline-start: 50%;
60
+ inline-size: var(--rc-bottom-sheet-handle-inline-size, 2rem);
61
+ block-size: var(--rc-bottom-sheet-handle-block-size, 0.25rem);
62
+ border-radius: 0;
63
+ background-color: transparent;
64
+ background-image:
65
+ radial-gradient(
66
+ circle 1px at calc(50% - 5px) 50%,
67
+ var(--rc-bottom-sheet-handle-color, ButtonBorder) 100%,
68
+ transparent 100%
69
+ ),
70
+ radial-gradient(
71
+ circle 1px at 50% 50%,
72
+ var(--rc-bottom-sheet-handle-color, ButtonBorder) 100%,
73
+ transparent 100%
74
+ ),
75
+ radial-gradient(
76
+ circle 1px at calc(50% + 5px) 50%,
77
+ var(--rc-bottom-sheet-handle-color, ButtonBorder) 100%,
78
+ transparent 100%
79
+ );
80
+ translate: -50% -50%;
81
+ }
82
+
83
+ :where(.rc-theme-tailwind, :host(.rc-theme-tailwind))
84
+ rc-bottom-sheet
85
+ > dialog
86
+ [data-rc-bottom-sheet-handle]:focus-visible {
87
+ outline: 0.125rem solid var(--rc-accent, Highlight);
88
+ outline-offset: 0.25rem;
89
+ }
90
+ }
@@ -0,0 +1,38 @@
1
+ @layer rc-theme-tailwind.components {
2
+ /* A muted trail with the current page in the full text color. */
3
+ :where(.rc-theme-tailwind, :host(.rc-theme-tailwind)) rc-breadcrumbs {
4
+ --rc-breadcrumbs-gap: 0.375rem;
5
+ --rc-breadcrumbs-separator: '/';
6
+ --rc-breadcrumbs-separator-color: var(--tailwind-border-color, GrayText);
7
+ --rc-breadcrumbs-current-color: var(--tailwind-on-surface, CanvasText);
8
+
9
+ color: var(--tailwind-on-surface-muted, CanvasText);
10
+ font-size: var(--tailwind-font-size, 0.95rem);
11
+ }
12
+
13
+ :where(.rc-theme-tailwind, :host(.rc-theme-tailwind)) rc-breadcrumbs > nav > ol > li > a {
14
+ border-radius: var(--tailwind-radius-sm, 0.25rem);
15
+ color: inherit;
16
+ text-decoration: none;
17
+ text-underline-offset: 0.2em;
18
+ }
19
+
20
+ :where(.rc-theme-tailwind, :host(.rc-theme-tailwind)) rc-breadcrumbs > nav > ol > li > a:hover {
21
+ color: var(--tailwind-on-surface, CanvasText);
22
+ text-decoration: underline;
23
+ }
24
+
25
+ :where(.rc-theme-tailwind, :host(.rc-theme-tailwind))
26
+ rc-breadcrumbs
27
+ > nav
28
+ > ol
29
+ > li
30
+ > a:focus-visible {
31
+ outline: var(--tailwind-focus-ring, 2px solid Highlight);
32
+ outline-offset: var(--tailwind-focus-ring-offset, 2px);
33
+ }
34
+
35
+ :where(.rc-theme-tailwind, :host(.rc-theme-tailwind)) rc-breadcrumbs [aria-current='page'] {
36
+ font-weight: 600;
37
+ }
38
+ }