Component theme

From indielayer/ui · View interactive version

Component theme is an AI agent skill from the GitHub repository indielayer/ui. Edit or add component theme classes and styles for shipped theme variants (base, carbon). Use when changing component appearance, Tailwind classes, theme tokens, Divider/Button themes, or files matching *.theme.ts. To add a new shipped theme pack, use the add-theme skill.

How to use this skill

Skill file

Component theme

Files

For component <Name>, one file per shipped theme id (currently base, carbon):

Import *Theme from ../<Name>.vue.

Structure

const theme: ButtonTheme = {
  classes: {
    wrapper({ props, slots, data }) { return ['...'] },
  },
  styles({ props, colors, css, data }) { /* CSS variables */ },
}
export default theme

Register

Export in every packages/ui/src/themes/<id>/components.ts (currently base, carbon).

Key must match the name used in useTheme('<Name>', ...).

Sync variants

When changing layout, states, or tokens in one variant, apply the same logical change to the others unless a design is intentionally different.

Reference: packages/ui/src/components/button/theme/Button.base.theme.ts

App-level `defaults`

Variant/layout booleans that should respect app.use(UI, { defaults }) must use optionalBooleanProp() from packages/ui/src/common/props.ts (not plain Boolean). Use useResolvedComponentProps when the template or script reads those props outside useTheme.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.