OpenParable
Skip to content
← Back to skills

Component Theme

Design
component-theme

Component Theme is an Agent Skill for design published in the indielayer/ui repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Edit or add component theme classes and styles for base and carbon variants. Use when changing component appearance, Tailwind classes, theme tokens, Divider/Button themes, or files matching *.theme.ts.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/indielayer/ui/blob/HEAD/.cursor/skills/component-theme/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/component-theme, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Component theme

Files

For component <Name>:

  • theme/<Name>.base.theme.ts
  • theme/<Name>.carbon.theme.ts

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 both:

  • packages/ui/src/themes/base/components.ts
  • packages/ui/src/themes/carbon/components.ts

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

Sync variants

When changing layout, states, or tokens in one variant, apply the same logical change to the other unless the carbon design intentionally differs.

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