Skip to content

Feature: Add Support for Component Variations #17

@khabubuphathu

Description

@khabubuphathu

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}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions