agents/projects/chrome-design-system/skills/generate-token-map/SKILL.md
This skill maps Chrome Design System (CDS) Figma design variables to their canonical C++ (Views/UI) and CSS (WebUI) equivalents in the Chromium codebase and generates a comprehensive Markdown reference file (tokens.md).
//src/).[Read figma-variables.md]
│
▼
[Step 1: Extract all Figma design variables across all categories]
│
▼
[Step 2: Research & map equivalent C++ (Views) identifiers]
│
▼
[Step 3: Research & map equivalent CSS (WebUI) variables]
│
▼
[Step 4: Write the formatted markdown table to tokens.md]
│
▼
[Step 5: Report summary statistics (total count & unmapped variables)]
figma-variables.mdagents/projects/chrome-design-system/skills/generate-token-map/assets/figma-variables.md using view_file.System & Surface ColorsPrimary, Tertiary & Container ColorsState, Ripple & Interaction ColorsOutline, Divider & Component ColorsReference & Static ColorsTypography (Fonts, Sizes, Weights, Line Heights)Typography (Composite Text Styles)Spacing TokensCorner Radius TokensElevation & ShadowsMiscellaneous & Gem Tokensgem/gradients/angular, gem/gradients/tab-strip).For each Figma variable, identify the matching C++ identifier in Chromium. Note that C++ names will not be identical to Figma variable names, but will contain similar words:
desktop/sys/*, desktop/ref/*): Search ui/color/color_id.h and chrome/browser/ui/color/chrome_color_id.h for ui::kColorSys*, ui::kColorRef*, kColor*, etc.ui/gfx/color_palette.h for gfx::kGoogle*, SK_ColorWHITE, SK_ColorBLACK, etc.desktop/font/*, desktop/font_size/*, desktop/line_height/*, composite styles): Search ui/views/style/typography.h and ui/views/style/typography_provider.cc for views::style::STYLE_*, views::style::CONTEXT_*, gfx::Font::Weight::*, etc.desktop/spacing/*) & Corner radius (desktop/corner-radius/*): Search ui/views/layout/layout_provider.h and ui/views/layout/layout_provider.cc for views::ShapeSysTokens::*, views::Emphasis::*, etc.desktop/elevation/*): Search ui/gfx/shadow_value.h and ui/color/color_id.h for ui::kColorShadowValue* and views::Emphasis::kHigh.If no matching identifier can be found, the result should be (none).
For each Figma variable, identify the closest matching CSS variable or token in Chromium WebUI:
ui/webui/resources/cr_elements/cr_shared_vars.css and ui/color/color_provider_utils.h for CSS variables such as --color-sys-*, --cr-focus-outline-color, --cr-hover-background-color, etc.--cr-primary-font-family, --cr-icon-size, etc.cr_shared_vars.css for --cr-card-border-radius, --cr-button-edge-spacing, --cr-section-padding, etc.cr_shared_vars.css for --cr-elevation-1, --cr-elevation-2, --cr-elevation-3, etc.If no matching CSS variable can be found, the result should be (none).
tokens.md# Chrome Design System Token Mappings (Figma to C++ & CSS)> [!WARNING] callout box at the top explicitly listing any unmappable Figma variables (e.g., variables with empty definitions in figma-variables.md).figma-variables.md.Figma Variable NameValue / DefinitionC++ Equivalent IdentifierCSS Equivalent Variableagents/projects/chrome-design-system/assets/tokens.md using write_to_file with Overwrite: true.After creating tokens.md: