Skip to content

Design Tokens - Color #20

@Shrinks99

Description

@Shrinks99

Proposal

Required reading: Truly Semantic by Donnie D'Amato TL;DR: purpose-priority-property

Color

A three-tiered system with primitives (scale), theme (semantic), and component (semantic) level tokens

  • Primitive level: color-red-050, color-blue-600, color-green-900 (implemented in https://github.com/webrecorder/hickory/blob/main/tokens/color.json)
  • Theme level: dark-primary-fill, light-danger-border, tritanopia-success-fill
    • Each points to a primitive level token[^2]
    • Used to enable dark, light, or accessibility themes (color blindness, high contrast, etc)
    • The purpose slot in the name defines the theme
    • The priority slot already aligns well with how we define our variables in Browsertrix with danger, primary, warning, etc!
  • Component level: button-primary-fill, input-error-border, switch-disabled-fill
    • These remain constant and are just used to style specific components or re-used elements throughout the app
    • The token they target is always a theme level token which can be swapped out with a theme change

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Implementing

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions