create-component-style

Implement component styles with vanilla-extract tokens and variants in a monorepo.

5|Updated Apr 22, 2023
One-click install
npx skills add https://github.com/idealjs/camphora --skill create-component-style
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-component-style
Source: https://github.com/idealjs/camphora/tree/main/.roo/skills/1-%E5%88%9B%E5%BB%BA%E6%A0%B7%E5%BC%8F
Command: npx skills add https://github.com/idealjs/camphora --skill create-component-style

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a repeatable, documented approach to implementing and sharing component styles within a monorepo, ensuring consistency across projects using vanilla-extract and token-driven design.

Core Features & Use Cases

  • Guided styling workflow: Defines how to design and apply base component styles, variants, and low-priority selectors using token systems.
  • Token-driven theming: Encourages centralizing colors, typography, and spacing in a tokens package and exporting through the styling package.
  • Documentation and exports: Describes how to organize files and ensure new styles are properly exported from packages.

Quick Start

Implement a new component style by following the steps in the SKILL.md, add base styles in packages/camphora-styled/src/<component>.css.ts, create variant classes, and export in packages/camphora-styled/src/index.ts.

Frequently Asked Questions about create-component-style

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize component styles with tokens in a monorepo?

You standardize component styles by centralizing colors, typography, and spacing in a tokens package, then exporting them through your styling package to ensure consistency across projects.

How do I create base styles and variants using vanilla-extract?

You create base styles and variants in vanilla-extract by defining a base class and a variant class within your component's CSS file, then exporting them from the package index to maintain a scalable styling architecture.

What is the best way to organize CSS architecture for new UI components?

The best way to organize CSS architecture for new UI components is to follow a repeatable workflow: add base styles in the component CSS file, create variant classes, apply low-priority selectors, and export them from the package index.

Do I need a design system to use vanilla-extract for component styling?

You do not explicitly need a full design system, but this approach targets developers who need consistent tokens and variants, making a token-driven design system highly beneficial for scalable styling within a monorepo.

When should I use low-priority selectors in component styling?

You should use low-priority selectors when you need to apply scalable styling overrides within a monorepo, ensuring that base component styles remain stable while allowing specific variant adjustments without causing CSS specificity conflicts.