Design Cues

The design system and variables that power Crafted UI components

Introduction

Crafted UI is built on a set of consistent design principles and variables that help maintain a cohesive visual language across all components. This design system provides the foundation for creating intuitive, accessible, and aesthetically pleasing user interfaces.

Design cues are visual signals that guide users through interfaces, create recognizable patterns, and establish hierarchy. They work together to create a cohesive experience that is both visually appealing and functionally effective.

Design Tokens

Design tokens are the building blocks of our design system. They represent the smallest visual design decisions, such as colors, spacing, typography, and more. By using tokens instead of hard-coded values, we maintain consistency across our components.

Base Tokens

Crafted UI uses these fundamental tokens to define its visual language:

  • Colors: Primary, secondary, accent, and semantic colors
  • Typography: Font families, sizes, weights, and line heights
  • Spacing: Consistent spacing scales for margins, padding, and gaps
  • Borders: Border widths, styles, and radii
  • Shadows: Elevation levels through shadows
  • Transitions: Animation duration and easing functions

Using Design Variables

In Crafted UI, you can access design variables through both CSS variables and Tailwind utility classes. This dual approach provides flexibility for different styling scenarios.

CSS Variables

You can directly use CSS variables in your custom styles:

.custom-element {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border: 1px solid var(--border);
}

Tailwind Classes

For a more declarative approach, use the semantic color classes in Tailwind:

<div class="bg-primary text-primary-foreground border border-border">
  This element uses Crafted UI's design tokens
</div>

Customizing Variables

To customize the design variables for your project, you can override the CSS variables in your global styles:

:root {
  --primary: 240 100% 50%; /* Blue */
  --secondary: 280 100% 50%; /* Purple */
}

Sizing Defaults

Crafted UI provides a set of default sizing variables that can be used to maintain consistent spacing and sizing across components. These variables come with reasonable defaults but can easily be customized for consistent alternative sizing.

Variable NameDescriptionDefault Value
container-containerBase container width80rem
container-navbarNavbar height4rem
container-sidebarSidebar width12rem

Color System

Colors are a critical aspect of our design system. Crafted UI uses a semantic color system that assigns meaning to colors beyond their visual appearance.

Semantic Colors

Rather than using color names like “green” or “blue,” we use functional names that describe the purpose:

Background Colors

Colors used for component and page backgrounds

b
—background
Text as text-foreground
Base container elements
m
—muted
Text as text-muted-foreground
Secondary container elements
p
—popover
Text as text-popover-foreground
Floating UI elements
c
—card
Text as text-card-foreground
Used for content containers
Foreground Colors

Colors used for text and icons

f
—foreground
Text as text-foreground
Default text color
m
—muted-foreground
Text as text-muted-foreground
Secondary text content
p
—popover
Text as text-popover-foreground
Text on popovers
c
—card
Text as text-card-foreground
Text on card elements
Action Colors

Colors used for interactive elements

p
—primary
Text as text-primary-foreground
Main action buttons
p
—primary-foreground
Text as text-primary
Main highlighted text
s
—secondary
Text as text-secondary-foreground
Alternative buttons
s
—secondary-foreground
Text as text-secondary-foreground
Secondary highlighted text
Accent & Destructive

Colors used for highlights and warnings

a
—accent
Text as text-accent-foreground
Highlighted UI elements
a
—accent-foreground
Text as text-accent-foreground
Text on highlighted areas
d
—destructive
Text as text-destructive-foreground
Destructive actions
d
—destructive-foreground
Text as text-destructive
Destructive action text
Borders & Inputs

Colors used for boundaries and form elements

—border
Borders and dividers
Component separators
—input
Form input borders
Form field outlines
—ring
Focus rings
Keyboard focus indicator
Chart Colors

Colors used for data visualization

—chart-1
Primary chart color
Main data series
—chart-2
Secondary chart color
Supporting data series
—chart-3
Tertiary chart color
Tertiary data series
—chart-4
Quaternary chart color
Additional data series

Color Themes

Crafted UI supports both light and dark themes out of the box. The color variables automatically adapt to the current theme, ensuring consistent appearance and proper contrast in both modes.

Light Theme

The light theme uses softer, more neutral colors with appropriate contrast for readability. Background colors are light with darker text.

Dark Theme

The dark theme inverts the color relationships, using dark backgrounds with light text. It maintains the same semantic color relationships while providing a comfortable viewing experience in low-light environments.

Theme Comparison

Light Theme
—background
—primary
—secondary
—foreground
Dark Theme
—background
—primary
—secondary
—foreground