Design system
Colour tokens, typography and components.
Colors
Use these colours instead of raw Tailwind colours like orange-600. They are named by what they're for, and they switch automatically in dark mode.
Use each token with the prefix it's listed under. Surface is a background colour, so bg-surface works but text-surface does nothing. Icon and utility tokens are the exception and work with any prefix.
Danger, warning, success and info work the same way. For a message box, use the subtle background with default or strong text. For a solid badge, use the strong background with the -on text colour.
Background
Canvas is the page background. Surface is for cards and panels. Raised is for menus and popovers that float above the page, sunken for areas set into it. Overlay dims the page behind a dialog. Inverse is the opposite of the page (dark in light mode, light in dark mode), for tooltips. The two state colours tint a row or item on hover and press.
.bg-canvas
.bg-surface
.bg-surface-raised
.bg-surface-sunken
.bg-overlay
.bg-inverse
.bg-state-hover
.bg-state-pressed
Text
Default is for body text, strong for headings, subtle for hints and captions. Disabled is for controls that can't be used. Inverse is for text on the inverse background. The link colours cover a link's normal, hover and visited states.
.text-subtle
.text-default
.text-strong
.text-disabled
.text-inverse
.text-link-default
.text-link-hover
.text-link-visited
Icon
Icons take their colour from text-icon-* classes. Use default next to body text, subtle for decorative icons and strong for icons that stand alone.
.text-icon-subtle
.text-icon-default
.text-icon-strong
.text-icon-disabled
.text-icon-inverse
Border
Subtle is for dividers, default for cards and inputs, strong for edges that need to stand out. Focus outlines the element that has keyboard focus. Selected outlines the chosen option in a group.
.border-subtle
.border-default
.border-strong
.border-focus
.border-selected
Brand
Brand colours for accents, not for buttons (use Action for those). Primary is this repo's black (near-white in dark mode), secondary is near-black (near-white in dark mode) and tertiary is a soft orange tint for highlighted areas.
.bg-primary
.text-primary
.border-primary
.bg-secondary
.text-secondary
.border-secondary
.bg-tertiary
.text-tertiary
.border-tertiary
Danger
Errors and failed actions.
.bg-danger-subtle
.bg-danger-strong
.text-danger-subtle
.text-danger-default
.text-danger-strong
.text-danger-on
.text-danger-icon-subtle
.text-danger-icon-default
.text-danger-icon-strong
.border-danger-subtle
.border-danger-default
.border-danger-strong
Warning
Things that need attention but don't stop the user.
.bg-warning-subtle
.bg-warning-strong
.text-warning-subtle
.text-warning-default
.text-warning-strong
.text-warning-on
.text-warning-icon-subtle
.text-warning-icon-default
.text-warning-icon-strong
.border-warning-subtle
.border-warning-default
.border-warning-strong
Success
Confirms that something worked.
.bg-success-subtle
.bg-success-strong
.text-success-subtle
.text-success-default
.text-success-strong
.text-success-on
.text-success-icon-subtle
.text-success-icon-default
.text-success-icon-strong
.border-success-subtle
.border-success-default
.border-success-strong
Info
Neutral notes and tips.
.bg-info-subtle
.bg-info-strong
.text-info-subtle
.text-info-default
.text-info-strong
.text-info-on
.text-info-icon-subtle
.text-info-icon-default
.text-info-icon-strong
.border-info-subtle
.border-info-default
.border-info-strong
Action - WIP — review based on usage later on
Button colours, with hover, pressed and disabled states for each kind of button. Use primary for the main action on a page, secondary for other actions, ghost for minor ones and danger for actions that delete or can't be undone. Put a button's text in the matching text colour, e.g. text-action-primary on bg-action-primary.
.bg-action-primary
.bg-action-primary-hover
.bg-action-primary-pressed
.bg-action-primary-disabled
.text-action-primary
.text-action-primary-disabled
.bg-action-secondary
.bg-action-secondary-hover
.bg-action-secondary-pressed
.bg-action-secondary-disabled
.text-action-secondary
.text-action-secondary-disabled
.bg-action-ghost
.bg-action-ghost-hover
.bg-action-ghost-pressed
.text-action-ghost
.text-action-ghost-disabled
.bg-action-danger
.bg-action-danger-hover
.bg-action-danger-pressed
.bg-action-danger-disabled
.text-action-danger
.text-action-danger-disabled
Utility
Colours for focus rings, selected text, loading placeholders and scrollbars. They work with any prefix, so ring-utility-focus-ring is valid.
.bg-utility-focus-ring
.bg-utility-selection
.bg-utility-skeleton-base
.bg-utility-skeleton-shimmer
.bg-utility-scrollbar-thumb