agents/projects/chrome-design-system/skills/generate-component-spec/assets/spec-template.md
This specification document outlines the mapping, design tokens, styling variants, and interactive states of the {{ComponentName}} component across Figma, C++ Views, and WebUI (Web Frontend).
[Summarize the component's role, interactive capabilities, and styling variants]
| Feature | Figma Component | C++ Views (Desktop) | WebUI (Web Frontend) |
|---|---|---|---|
| Component Name | {{ComponentName}} | views::{{ViewsClassName}} | <{{webui-element-tag}}> |
| Source Files | Figma Link: {{nodeId}} | path/to/views/header.h | path/to/webui/controller.ts |
[In the Source Files row, include links to all components defined in the Component Name row. For Views, only include header .h files. For WebUI, only include controller .ts files (disregard HTML or CSS).]
[Table mapping Figma variants like Primary, Tonal, Outlined, Text, and icon slots (Leading, Trailing) to C++ classes/enums and WebUI custom classes or elements]
[Table mapping interactive states like Default, Hovered, Pressed, Disabled, Focused to Figma state properties, C++ ButtonStates / views::FocusRing, and WebUI CSS classes / pseudo-classes]
[Comprehensive side-by-side mapping table of design tokens covering colors, container/foreground pairings, border outlines, typography (weights, sizes, line heights), outer/inner paddings, and corner radii]
[Detailed sections describing shape/corner-radius discrepancies, static vs. dynamic theme coloring, font size inheritance differences, line-height overrides, and responsive or asymmetric spacing shifts]
[Detailed analysis of features or visual treatments that have layout mismatches, variant discrepancies, or custom behavioral configurations between Figma and codebases (such as double-icon limitations or focus ring logic)]
[Guidelines for icon usage, if applicable]
views::View (Base layout unit)
└── views::Textfield (Handles click/key input events and selection layers)
HTMLElement (Browser element base)
└── LitElement / CrLitElement (Web UI host)
└── CrInputElement (Reusable cr-input component wrapper)