@skriv/ads 0.0.0-stage → 0.2.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.
Files changed (36) hide show
  1. package/README.md +47 -2
  2. package/bin/ads.mjs +59 -0
  3. package/dist/manifest.json +53 -0
  4. package/dist/skills/ads-code-review/SKILL.md +12 -0
  5. package/dist/skills/ads-code-to-figma/SKILL.md +10 -0
  6. package/dist/skills/ads-figma-to-code/SKILL.md +10 -0
  7. package/dist/skills/ads-init/SKILL.md +16 -0
  8. package/dist/skills/ads-init/profile.md +11 -0
  9. package/dist/skills/ads-init/scripts/connect.py +75 -0
  10. package/dist/skills/ads-record/SKILL.md +12 -0
  11. package/dist/skills/heroui-react/LICENSE.txt +199 -0
  12. package/dist/skills/heroui-react/SKILL.md +234 -0
  13. package/dist/skills/heroui-react/scripts/get_component_docs.mjs +157 -0
  14. package/dist/skills/heroui-react/scripts/get_docs.mjs +148 -0
  15. package/dist/skills/heroui-react/scripts/get_source.mjs +160 -0
  16. package/dist/skills/heroui-react/scripts/get_styles.mjs +160 -0
  17. package/dist/skills/heroui-react/scripts/get_theme.mjs +177 -0
  18. package/dist/skills/heroui-react/scripts/list_components.mjs +134 -0
  19. package/dist/skills/heroui-theming/LICENSE.txt +199 -0
  20. package/dist/skills/heroui-theming/SKILL.md +268 -0
  21. package/dist/skills/heroui-theming/references/any-framework.md +219 -0
  22. package/dist/skills/heroui-theming/references/components.md +237 -0
  23. package/dist/skills/heroui-theming/references/theme-recipe.md +701 -0
  24. package/dist/skills/heroui-theming/references/tokens.md +258 -0
  25. package/dist/skills/heroui-theming/scripts/_styles_dir.mjs +112 -0
  26. package/dist/skills/heroui-theming/scripts/list_component_classes.mjs +319 -0
  27. package/dist/skills/heroui-theming/scripts/list_tokens.mjs +157 -0
  28. package/dist/templates/flow.md +12 -0
  29. package/dist/templates/project.md +13 -0
  30. package/dist/templates/review.md +14 -0
  31. package/dist/templates/routing.md +11 -0
  32. package/dist/templates/theming.md +26 -0
  33. package/package.json +32 -4
  34. package/src/doctor.mjs +38 -0
  35. package/src/install.mjs +140 -0
  36. package/src/video.mjs +18 -0
@@ -0,0 +1,268 @@
1
+ ---
2
+ name: heroui-theming
3
+ description: "Globally customize HeroUI v3 and author complete custom themes with CSS only. Use when restyling HeroUI components app-wide, changing design tokens (colors, radius, shadows, fields), overriding BEM component classes, adding variants, creating a named light/dark theme, or using @heroui/styles on plain HTML and non-React frameworks. Keywords: HeroUI theme, theming, custom theme, design tokens, CSS variables, oklch, BEM, data-theme, dark mode, @heroui/styles, global styles."
4
+ metadata:
5
+ author: heroui
6
+ version: "1.0.0"
7
+ ---
8
+
9
+ # HeroUI v3 Theming Guide
10
+
11
+ HeroUI's look lives entirely in `@heroui/styles`: plain CSS made of **theme tokens** and **BEM component classes** in cascade layers. `@heroui/react` only adds behavior and puts those class names on the DOM. So everything visual can be changed globally with CSS — no component wrappers, no forks, no JavaScript — and the same CSS works on any framework or plain HTML.
12
+
13
+ Use this skill to customize HeroUI globally or to build a full theme. For building UIs with the components, use the `heroui-react` skill.
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ curl -fsSL https://heroui.com/install | bash -s heroui-theming
19
+ ```
20
+
21
+ ## Mental Model
22
+
23
+ ```
24
+ @layer theme, base, components, utilities; ← declared by @heroui/styles
25
+
26
+ theme tokens --accent, --radius, --surface-shadow, --field-border…
27
+ base resets border color, overlay keyframes
28
+ components BEM classes .button, .button--primary, .card__header, .switch__thumb…
29
+ utilities Tailwind bg-accent, rounded-xl, shadow-surface, status-focused…
30
+ ```
31
+
32
+ - **Later layers win** over earlier ones regardless of selector specificity. **Unlayered CSS beats every layer.**
33
+ - One chain connects everything: token `--accent` → Tailwind mapping `--color-accent: var(--accent)` → utility `bg-accent` → component `.button--primary { --button-bg: var(--accent) }`. Change the token and the whole chain follows.
34
+ - Colors without a suffix are backgrounds; `-foreground` is the text placed on them. They change as a pair.
35
+ - Default light tokens apply on `:root`, `.light`, `[data-theme="light"]`; dark on `.dark`, `[data-theme="dark"]`.
36
+
37
+ ## Always Inspect the Installed Version First
38
+
39
+ Never invent a token, class, or selector. Read them from the project's own `node_modules` (no network needed):
40
+
41
+ ```bash
42
+ node scripts/list_tokens.mjs # tokens: shared, light, dark, Tailwind mapping
43
+ node scripts/list_component_classes.mjs # every component stylesheet
44
+ node scripts/list_component_classes.mjs button switch # blocks, elements, modifiers, states, custom properties, tokens read
45
+ node scripts/list_component_classes.mjs modal --css # plus the raw CSS
46
+ ```
47
+
48
+ `scripts/` is this skill's folder. Run the scripts with the **project root as the working directory** — they resolve `@heroui/styles` from there — or pass `--dir <path-to>/node_modules/@heroui/styles`. The files they read:
49
+
50
+ | What | Path in the installed package |
51
+ | ---------------- | --------------------------------------------------------------- |
52
+ | Token values | `node_modules/@heroui/styles/dist/themes/default/variables.css` |
53
+ | Tailwind mapping | `node_modules/@heroui/styles/dist/themes/shared/theme.css` |
54
+ | Component CSS | `node_modules/@heroui/styles/dist/components/<name>.css` |
55
+
56
+ Read only. **Never edit `node_modules`.**
57
+
58
+ ## Decision Ladder
59
+
60
+ Use the lowest rung that solves the request. Each rung up costs more to maintain.
61
+
62
+ | # | The request sounds like | Use | Reference |
63
+ | --- | -------------------------------------------------------------------------- | ----------------------------------- | --------------------------------------------- |
64
+ | 1 | "Change the brand color / make everything rounder / flatter" | Theme tokens | [tokens.md](references/tokens.md) |
65
+ | 2 | "Primary buttons should be black" (one component's colors) | That component's custom properties | [components.md](references/components.md) |
66
+ | 3 | "All buttons uppercase / cards get a border" (shape, type, layout, states) | BEM override in `@layer components` | [components.md](references/components.md) |
67
+ | 4 | "Add a gradient button next to the existing ones" | New modifier class | [components.md](references/components.md) |
68
+ | 5 | "Create a theme called X" / a full visual identity with light + dark | Named theme folder | [theme-recipe.md](references/theme-recipe.md) |
69
+ | 6 | "Use preset X but in our colors" (a theme someone else wrote) | Brand palette layered over it | [theme-recipe.md](references/theme-recipe.md#restyling-a-theme-you-didnt-write) |
70
+
71
+ A one-off tweak on a single element is not theming: use `className` utilities there.
72
+
73
+ All snippets below go in the app's main CSS file, **after** the HeroUI import:
74
+
75
+ ```css
76
+ @import "tailwindcss";
77
+ @import "@heroui/styles";
78
+ /* customizations here */
79
+ ```
80
+
81
+ ### 1. Theme tokens
82
+
83
+ ```css
84
+ @layer theme {
85
+ /* Same in both modes */
86
+ :root {
87
+ --accent: oklch(0.55 0.2 300);
88
+ --accent-foreground: var(--snow);
89
+ --radius: 0.375rem;
90
+ }
91
+
92
+ /* Mode-specific tokens need BOTH blocks, light first */
93
+ :root,
94
+ .light,
95
+ [data-theme="light"] {
96
+ --background: oklch(0.98 0.01 300);
97
+ }
98
+
99
+ .dark,
100
+ [data-theme="dark"] {
101
+ --background: oklch(0.16 0.02 300);
102
+ }
103
+ }
104
+ ```
105
+
106
+ A token set only on `:root` also applies in dark mode, because your rule outranks the default dark block. That is right for `--accent` or `--radius`, and wrong for `--background`, `--surface`, `--foreground`, shadows: give those a dark value too.
107
+
108
+ Hover, soft, and border-level colors (`--accent-hover`, `--accent-soft`, `--field-hover`…) are calculated from the base tokens. Do not set them unless the result needs tuning.
109
+
110
+ ### 2. Component custom properties
111
+
112
+ Many components paint from their own properties (`--button-bg`, `--chip-bg`, `--switch-control-bg-checked`…). They are declared **on the component class**, so set them there, not on `:root`:
113
+
114
+ ```css
115
+ @layer components {
116
+ .button--primary {
117
+ --button-bg: var(--foreground);
118
+ --button-bg-hover: color-mix(in oklab, var(--foreground) 88%, var(--background));
119
+ --button-bg-pressed: color-mix(in oklab, var(--foreground) 80%, var(--background));
120
+ --button-fg: var(--background);
121
+ }
122
+ }
123
+ ```
124
+
125
+ Hover, pressed, focus, and disabled keep working because the base rules still do the painting.
126
+
127
+ ### 3. BEM overrides
128
+
129
+ ```css
130
+ @layer components {
131
+ .button {
132
+ @apply font-semibold tracking-wide uppercase;
133
+ }
134
+
135
+ .card {
136
+ @apply border border-border;
137
+ }
138
+
139
+ /* `.card` now sets a border: re-assert the modifier it would clobber */
140
+ .card--transparent {
141
+ @apply border-none;
142
+ }
143
+
144
+ /* States: the pseudo-class AND the data attribute, as in the base file */
145
+ .button:active,
146
+ .button[data-pressed="true"] {
147
+ transform: scale(0.95);
148
+ }
149
+ }
150
+ ```
151
+
152
+ ### 4. New modifiers
153
+
154
+ Add a class in `@layer components` that assigns the component's custom properties (all of them), e.g. `.button--brand { --button-bg: var(--success); --button-bg-hover: var(--success-hover); --button-bg-pressed: var(--success-hover); --button-fg: var(--success-foreground); }`. Use it with `<Button className="button--brand">` or `<button class="button button--brand">`.
155
+
156
+ ### 5. A named theme
157
+
158
+ A theme is a folder with one fixed structure, imported after HeroUI and activated on `<html>`:
159
+
160
+ ```
161
+ src/themes/<name>/
162
+ ├── index.css
163
+ ├── variables.css
164
+ └── components/
165
+ ├── index.css
166
+ └── <component>.css # one file per overridden component
167
+ ```
168
+
169
+ ```css
170
+ /* ── themes/<name>/index.css ── */
171
+ @import "./variables.css" layer(theme);
172
+ @import "./components/index.css" layer(components);
173
+
174
+ /* ── themes/<name>/variables.css: the full palette in BOTH blocks ── */
175
+ .<name>-light,
176
+ [data-theme="<name>-light"] {
177
+ color-scheme: light;
178
+ /* --background, --foreground, --surface*, --overlay, --default, --accent, status colors,
179
+ --field-*, --border, --separator, --focus, --radius, shadows, your own --<name>-* tokens */
180
+ }
181
+
182
+ .<name>-dark,
183
+ [data-theme="<name>-dark"] {
184
+ color-scheme: dark;
185
+ /* the same tokens, dark values */
186
+ }
187
+
188
+ /* ── themes/<name>/components/index.css ── */
189
+ @import "./button.css";
190
+ @import "./card.css";
191
+
192
+ /* ── app/globals.css ── */
193
+ @import "tailwindcss";
194
+ @import "@heroui/styles";
195
+ @import "../themes/<name>/index.css";
196
+ ```
197
+
198
+ ```html
199
+ <html data-theme="<name>-light">
200
+ <body class="bg-background text-foreground"></body>
201
+ </html>
202
+ ```
203
+
204
+ Switch to dark with `data-theme="<name>-dark"` (a class of the same name also works). **Read [theme-recipe.md](references/theme-recipe.md) before writing a theme**: it has the step-by-step process and a complete worked example with light + dark variables and five component files.
205
+
206
+ A theme with a tactile look (raised, pressed, outlined) applies that **material** to every "on" state, not only buttons: switch, checkbox, radio, toggle button, tab indicator, slider, progress and meter fills, selected calendar days. The recipe's [Material](references/theme-recipe.md#material-one-look-for-every-on-state) section lists each selector and the pseudo-elements already in use.
207
+
208
+ ### 6. Restyle a theme you didn't write
209
+
210
+ Keep the preset's material and swap its palette: import the preset, then your `brand.css` with `layer(theme)`, keyed on the **preset's** selectors. Point every token the preset tints at your palette (`--overlay: var(--surface)`, `--field-border: var(--border)`) instead of copying its component CSS. Steps: [Restyling a theme you didn't write](references/theme-recipe.md#restyling-a-theme-you-didnt-write).
211
+
212
+ ## Without React
213
+
214
+ `@heroui/styles` works on plain HTML and any framework: load the CSS, put the BEM classes on real elements, set state attributes yourself.
215
+
216
+ ```html
217
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@heroui/styles@3/dist/heroui.min.css" />
218
+
219
+ <button class="button button--primary">Save</button>
220
+ <button class="switch" role="switch" aria-checked="true">
221
+ <span class="switch__content">
222
+ <span class="switch__control"><span class="switch__thumb"></span></span>
223
+ Notifications
224
+ </span>
225
+ </button>
226
+ ```
227
+
228
+ With a Tailwind v4 build, use `@import "tailwindcss"; @import "@heroui/styles";` instead. The prebuilt file has no Tailwind utilities and no `@apply`. Details, a runnable page, selective imports, and variant functions for Vue/Svelte: [any-framework.md](references/any-framework.md).
229
+
230
+ ## Rules
231
+
232
+ 1. **Tokens before overrides.** If a token can express it, do not write component CSS.
233
+ 2. **`oklch()` for colors.** Keep hue steady across a ramp and move lightness.
234
+ 3. **Semantic tokens, not hardcoded colors**, in every component override — a literal color is wrong in the other mode.
235
+ 4. **Keep `-foreground` pairs readable** (WCAG AA, 4.5:1 for text). Check soft variants (`--accent-soft` + `--accent-soft-foreground`) too.
236
+ 5. **Both modes, always.** Any mode-specific token gets a light and a dark value.
237
+ 6. **Style states twice:** pseudo-class + data attribute (`:hover` + `[data-hovered="true"]`, `:active` + `[data-pressed="true"]`, `:focus-visible` + `[data-focus-visible="true"]`, `:disabled` + `[data-disabled="true"]`/`[aria-disabled="true"]`). Copy the selector list from the base file; where it deliberately uses only one form, do the same.
238
+ 7. **Overrides go in `@layer components`**, never unlayered (unlayered CSS would also beat `className` utilities) and never with `!important`.
239
+ 8. **Match the base rule's specificity**, and re-assert modifiers that a block-level override clobbers.
240
+ 9. **Do not break focus rings.** The ring is a `box-shadow`: on focusable components use shadow utilities (`@apply shadow-[…]`) rather than raw `box-shadow`, and never set a shadow token to `none` (use `0 0 0 0 transparent`).
241
+ 10. **Do not remove disabled or reduced-motion handling.** After a custom `transition`, add `@apply motion-reduce:transition-none;`.
242
+ 11. **Apply themes on `<html>`.** Overlays portal to `<body>`, and calculated tokens only recompute on the root element.
243
+ 12. **Complete class names only.** In `@apply`, `className`, and variant maps, write full names (`button--brand`); never build them from strings.
244
+ 13. **Never edit `node_modules`** or copy HeroUI's CSS wholesale; override the smallest part.
245
+ 14. **Remove conflicting leftovers.** An old unlayered `:root { --accent: … }` silently beats a named theme.
246
+ 15. **One material for every "on" state.** If filled buttons are raised, so are the checked switch, the slider fill and the selected day.
247
+ 16. **Text in rem, shape in px** when the app has a text-size setting: set `--radius` and `--spacing` in px so only text scales.
248
+
249
+ ## Verification Checklist
250
+
251
+ Build the CSS first (an unknown utility in `@apply` fails the build). Then, in **light and dark**:
252
+
253
+ - [ ] Canvas and text (`bg-background text-foreground` on `<body>`)
254
+ - [ ] Button: every variant, hover, pressed, keyboard focus ring, disabled
255
+ - [ ] Fields: Input, Select, Checkbox, Radio, Switch — rest, hover, focus, invalid, disabled, placeholder
256
+ - [ ] Surfaces: Card variants, Accordion, Table, Tabs
257
+ - [ ] Overlays: Popover/Dropdown/Select list, Tooltip + arrow, Modal + backdrop, Toast — background, shadow, radius
258
+ - [ ] Soft colors: Chip/Badge/Alert in accent, success, warning, danger
259
+ - [ ] "On" states share the material: primary button, switch, checkbox, radio, toggle button, tab indicator, slider, progress/meter, selected day
260
+ - [ ] Over a preset: no token still carries its tint (overlay, field border, backdrop, scrollbar, charts)
261
+ - [ ] Reduced motion still disables new transitions
262
+ - [ ] If the project has a `DESIGN.md`, update it to the new tokens
263
+
264
+ ## References
265
+
266
+ Load on demand: [tokens.md](references/tokens.md) (every token, default, utility, effect), [components.md](references/components.md) (BEM conventions, states, per-component properties), [theme-recipe.md](references/theme-recipe.md) (full theme process + worked example), [any-framework.md](references/any-framework.md) (plain HTML, Vue, Svelte, CDN, selective imports).
267
+
268
+ Human docs: [Theming](https://heroui.com/docs/react/getting-started/theming.mdx), [Colors](https://heroui.com/docs/react/getting-started/colors.mdx), [Styling](https://heroui.com/docs/react/getting-started/styling.mdx), [Dark Mode](https://heroui.com/docs/react/getting-started/dark-mode.mdx).
@@ -0,0 +1,219 @@
1
+ # Using HeroUI Styles Without React
2
+
3
+ `@heroui/styles` has no React dependency. It ships plain CSS (theme tokens + BEM component classes) and framework-agnostic variant functions. Any markup that carries the right classes and state attributes gets HeroUI's look: plain HTML, Vue, Svelte, Angular, Astro, server templates, web components.
4
+
5
+ **What you get:** the visual design, including hover, pressed, focus-visible, disabled, and selected styles.
6
+ **What you do not get:** behavior. Keyboard navigation, focus management, ARIA wiring, overlay positioning, and enter/exit state come from React Aria in `@heroui/react`. On other stacks you provide them (native elements first, then a headless library).
7
+
8
+ ## Three ways to load the CSS
9
+
10
+ | Setup | How | Tailwind utilities | `@apply` in your CSS |
11
+ | --------------------- | ---------------------------------------------------------------------------------------------------- | ------------------ | -------------------- |
12
+ | Tailwind CSS v4 build | `@import "tailwindcss"; @import "@heroui/styles";` in the main CSS file | Yes | Yes |
13
+ | Prebuilt file | Link `node_modules/@heroui/styles/dist/heroui.min.css` (copy it to your static assets) | No | No |
14
+ | CDN | `<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@heroui/styles@3/dist/heroui.min.css" />` | No | No |
15
+
16
+ Notes:
17
+
18
+ - Pin the CDN version in production (`@heroui/styles@3.2.7`), since component markup and CSS must match.
19
+ - `dist/heroui.min.css` is not in the package's `exports` map. Bundlers that enforce `exports` reject `import "@heroui/styles/dist/heroui.min.css"`; copy or link the file by path instead.
20
+ - The prebuilt file contains HeroUI's component classes, theme tokens, and Tailwind's base reset (preflight: margins, borders, and heading sizes are reset page-wide). It does **not** contain Tailwind utilities, so `class="flex gap-4 bg-background"` does nothing there. Write layout CSS yourself or use the Tailwind build.
21
+
22
+ ### Selective imports (Tailwind build)
23
+
24
+ Import only what a page needs. Use explicit file paths; directory specifiers such as `@heroui/styles/components` are not exported.
25
+
26
+ ```css
27
+ @layer theme, base, components, utilities;
28
+
29
+ @import "tailwindcss";
30
+ @import "@heroui/styles/base" layer(base);
31
+ @import "@heroui/styles/themes/default" layer(theme);
32
+ @import "@heroui/styles/utilities";
33
+ @import "@heroui/styles/variants";
34
+
35
+ @import "@heroui/styles/components/button.css" layer(components);
36
+ @import "@heroui/styles/components/card.css" layer(components);
37
+ ```
38
+
39
+ `utilities` is required: component CSS applies `status-focused`, `status-disabled`, `no-highlight`, and others from it. `themes/default` brings both the token values and the Tailwind mapping. Shared primitives (`label.css`, `description.css`, `field-error.css`, `close-button.css`) go before the components that restyle them; `components/index.css` shows the full order.
40
+
41
+ ## Minimal working example (no build step)
42
+
43
+ ```html
44
+ <!doctype html>
45
+ <html lang="en" data-theme="light">
46
+ <head>
47
+ <meta charset="utf-8" />
48
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
49
+ <title>HeroUI without React</title>
50
+ <link
51
+ rel="stylesheet"
52
+ href="https://cdn.jsdelivr.net/npm/@heroui/styles@3/dist/heroui.min.css"
53
+ />
54
+ <style>
55
+ /* The prebuilt file has no utilities: paint the canvas with tokens */
56
+ body {
57
+ background: var(--background);
58
+ color: var(--foreground);
59
+ font-family: var(--font-sans);
60
+ padding: 2rem;
61
+ }
62
+
63
+ .stack {
64
+ display: flex;
65
+ flex-wrap: wrap;
66
+ align-items: center;
67
+ gap: 1rem;
68
+ margin-bottom: 1.5rem;
69
+ }
70
+
71
+ /* Global customization works exactly as with React */
72
+ @layer theme {
73
+ :root {
74
+ --accent: oklch(0.55 0.2 300);
75
+ --radius: 0.375rem;
76
+ }
77
+ }
78
+
79
+ @layer components {
80
+ .button {
81
+ font-weight: 600;
82
+ }
83
+ }
84
+ </style>
85
+ </head>
86
+ <body>
87
+ <div class="stack">
88
+ <button class="button button--primary">Save</button>
89
+ <button class="button button--secondary">Cancel</button>
90
+ <button class="button button--outline button--sm">Small outline</button>
91
+ <button class="button button--danger" disabled>Disabled</button>
92
+ <span class="chip chip--accent chip--soft"><span class="chip__label">New</span></span>
93
+ </div>
94
+
95
+ <div class="stack">
96
+ <div class="card card--default" style="width: 20rem">
97
+ <div class="card__header">
98
+ <h3 class="card__title">Notifications</h3>
99
+ <p class="card__description">Choose what you want to hear about.</p>
100
+ </div>
101
+ <div class="card__content">
102
+ <input class="input input--full-width" type="email" placeholder="you@example.com" />
103
+ </div>
104
+ <div class="card__footer">
105
+ <button class="switch" role="switch" aria-checked="false" type="button">
106
+ <span class="switch__content">
107
+ <span class="switch__control"><span class="switch__thumb"></span></span>
108
+ Email me updates
109
+ </span>
110
+ </button>
111
+ </div>
112
+ </div>
113
+ </div>
114
+
115
+ <button class="button button--tertiary" id="mode" type="button">Toggle dark mode</button>
116
+
117
+ <script>
118
+ // State is yours to manage: HeroUI styles the ARIA / data attributes you set.
119
+ for (const el of document.querySelectorAll('[role="switch"]')) {
120
+ el.addEventListener("click", () => {
121
+ el.setAttribute("aria-checked", String(el.getAttribute("aria-checked") !== "true"));
122
+ });
123
+ }
124
+
125
+ document.getElementById("mode").addEventListener("click", () => {
126
+ const root = document.documentElement;
127
+
128
+ root.dataset.theme = root.dataset.theme === "dark" ? "light" : "dark";
129
+ });
130
+ </script>
131
+ </body>
132
+ </html>
133
+ ```
134
+
135
+ ## The markup contract
136
+
137
+ 1. **Classes.** Root gets the block plus modifiers (`button button--primary button--lg`); parts get element classes (`card__header`). Look them up with `node scripts/list_component_classes.mjs <component>` or in [components.md](components.md).
138
+ 2. **Native state is free.** `:hover`, `:active`, `:focus-visible`, `:disabled`, `:focus` on inputs all work on real `<button>`, `<a>`, `<input>` elements with no attributes.
139
+ 3. **Non-native state is an attribute you set.** HeroUI's CSS reads the same attributes React Aria writes:
140
+
141
+ | State | Set on the block |
142
+ | --------------------------- | ----------------------------------------------------------------------------- |
143
+ | Selected / on | `aria-checked="true"` or `data-selected="true"` |
144
+ | Disabled (non-form element) | `aria-disabled="true"` or `data-disabled="true"` |
145
+ | Invalid | `data-invalid="true"` (fields also accept `aria-invalid="true"` where listed) |
146
+ | Loading | `data-pending="true"` |
147
+ | Overlay animation | `data-entering="true"` / `data-exiting="true"`, `data-placement="top | bottom | left | right"` |
148
+
149
+ 4. **Structure matters for compound parts.** Selectors such as `.switch[aria-checked="true"] .switch__control` expect the documented nesting. Mirror the anatomy from the component docs (`https://heroui.com/docs/react/components/<name>.mdx`).
150
+ 5. **Use real elements.** A `<button>` gets focus, keyboard activation, and `:disabled` for free; a `<div class="button">` gets none of it.
151
+
152
+ ## Variant functions (any JS framework)
153
+
154
+ The JS entry exports the same `tailwind-variants` functions the React components use. They return class strings, so they work anywhere.
155
+
156
+ ```ts
157
+ import {buttonVariants, cardVariants} from "@heroui/styles";
158
+
159
+ buttonVariants({variant: "primary"}); // "button button--md button--primary"
160
+ buttonVariants({variant: "secondary", size: "lg", isIconOnly: true});
161
+
162
+ // Compound components return one function per part
163
+ const card = cardVariants({variant: "secondary"});
164
+
165
+ card.base(); // "card card--secondary"
166
+ card.header(); // "card__header"
167
+ ```
168
+
169
+ ```vue
170
+ <script setup lang="ts">
171
+ import {buttonVariants} from "@heroui/styles";
172
+ </script>
173
+
174
+ <template>
175
+ <button :class="buttonVariants({variant: 'primary'})">Save</button>
176
+ </template>
177
+ ```
178
+
179
+ ```svelte
180
+ <script lang="ts">
181
+ import {buttonVariants} from "@heroui/styles";
182
+ </script>
183
+
184
+ <button class={buttonVariants({variant: "primary"})}>Save</button>
185
+ ```
186
+
187
+ ## Theming in this mode
188
+
189
+ Everything in the skill applies unchanged — tokens, component custom properties, BEM overrides, named themes — because none of it depends on React.
190
+
191
+ - **Tailwind build:** follow [theme-recipe.md](theme-recipe.md) as written.
192
+ - **Prebuilt / CDN:** same files, plain CSS only. Replace `@apply` with declarations, and put the rules in the layers by hand:
193
+
194
+ ```css
195
+ @layer theme {
196
+ [data-theme="brand-light"] {
197
+ color-scheme: light;
198
+ --accent: oklch(0.55 0.2 300);
199
+ --accent-foreground: var(--snow);
200
+ --radius: 0.25rem;
201
+ }
202
+
203
+ [data-theme="brand-dark"] {
204
+ color-scheme: dark;
205
+ /* full dark palette: see theme-recipe.md, step 2 */
206
+ }
207
+ }
208
+
209
+ @layer components {
210
+ .button {
211
+ font-weight: 600;
212
+ letter-spacing: 0.02em;
213
+ }
214
+ }
215
+ ```
216
+
217
+ Load this after `heroui.min.css`. The layer names already exist in the prebuilt file, so your rules join them in the right order.
218
+
219
+ Tokens that only `@heroui/react` reads (`--skeleton-animation`, `--tooltip-delay`, `--tooltip-close-delay`) have no effect without React.