component-styles

Standardize styling APIs for CDS components across web and mobile platforms.

493|101|Updated Nov 8, 2024
One-click install
npx skills add https://github.com/coinbase/cds --skill component-styles
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: component-styles
Source: https://github.com/coinbase/cds/tree/main/.claude/skills/component-styles
Command: npx skills add https://github.com/coinbase/cds --skill component-styles

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a standardized way to add and manage styling APIs (styles, classNames, and static classNames) for CDS components, ensuring consistency and maintainability across the design system.

Core Features & Use Cases

  • Define Styleable Elements: Identifies and documents elements within a component that can be targeted for styling.
  • Generate Style Props: Automatically creates styles and classNames props for components.
  • Enforce Naming Conventions: Ensures consistent naming for selectors and class names (e.g., cds-ComponentName-selectorName).
  • Add Static ClassNames: Implements a pattern for static class names in web components for CSS targeting.
  • Mobile Styling Pattern: Provides a simpler pattern for styling mobile components.
  • JSDoc Documentation: Enforces clear JSDoc comments for selectors and their usage.
  • Testing: Includes guidelines for adding tests to verify static class name application.
  • Documentation Updates: Guides users on updating component documentation after implementing the styles API.

Quick Start

Use the component-styles skill to add the styles API to the Button component, ensuring all approved selectors are documented with JSDoc and static class names are implemented following the cds-ComponentName-selectorName convention.

Frequently Asked Questions about component-styles

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

FAQPage Schema
How do I standardize component styling APIs across web and mobile platforms?

To standardize component styling API implementation, identify styleable elements, generate styles and classNames props, and enforce naming conventions like cds-ComponentName-selectorName across web and mobile platforms.

How do I add static class names to web components for CSS targeting?

Add static class names to web components by implementing the cds-ComponentName-selectorName pattern, which allows direct CSS targeting and must be verified through specific tests to ensure correct application.

What is the best way to document CSS selectors in a React design system?

The best way to document CSS selectors in a React design system is by using JSDoc comments to define and explain each styleable element and selector, ensuring clear usage guidelines and maintainability.

How does component styling differ for mobile components compared to web?

Mobile component styling uses a simplified approach compared to web components, which utilize static class names for CSS targeting, ensuring consistent styling API management without web-specific static class implementations.

What naming conventions should I use for design system component selectors?

Use the cds-ComponentName-selectorName naming convention for design system component selectors to ensure consistency, maintainability, and clear identification of styleable elements across the system.

Do I need to update component documentation after implementing a styles API?

Yes, you must update component documentation after implementing the styles API to reflect the newly added styles and classNames props, ensuring all approved selectors are properly recorded for developers.