google-labs-code / google-labs-code/design.md

Feature: Add Support for Component Variations

Open
#17 6 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
28k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

Summary

Introduce structured support for component variations (variants) in DESIGN.md to allow more expressive, scalable, and semantically rich component definitions beyond flat key-based naming.

Motivation

Currently, component variants (e.g. hover, active, size variations) are represented as separate component entries using naming conventions:

components:
  button-primary:
    backgroundColor: "{colors.tertiary}"
  button-primary-hover:
    backgroundColor: "{colors.tertiary-container}"
Proposal

Add a variants field under components to explicitly model variations:

components:
  button:
    base:
      backgroundColor: "{colors.tertiary}"
      textColor: "{colors.on-tertiary}"
      rounded: "{rounded.sm}"
      padding: 12px

    variants:
      intent:
        primary:
          backgroundColor: "{colors.tertiary}"
        secondary:
          backgroundColor: "{colors.secondary}"

      size:
        sm:
          padding: 8px
        md:
          padding: 12px
        lg:
          padding: 16px

      state:
        hover:
          backgroundColor: "{colors.tertiary-container}"
        active:
          backgroundColor: "{colors.primary}"
        disabled:
          backgroundColor: "{colors.neutral}"

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with DESIGN.md and compare the current flat component entries with the proposed base and variants structure. Define how intent, size, and state variations should be represented, including compatibility with existing naming conventions; the work is done when the format specification clearly documents the structured variants model.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown, yaml
Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.