Skip to content

Colors

The DS-Bridge color system provides a comprehensive palette designed for accessibility, consistency, and visual harmony.

Color Philosophy

Our color system is built on three principles:

  1. Semantic Naming: Colors are named by purpose (primary, error) not appearance (blue, red)
  2. Accessibility First: All color combinations meet WCAG 2.1 AAA contrast requirements
  3. Figma Sync: Colors map 1-to-1 with Figma design variables

Primary Brand Colors

The primary brand colors define your product's identity.

Primary

primary
#6366F1
Indigo-600
primaryDark
#4F46E5
Indigo-700
primaryLight
#818CF8
Indigo-400
primaryLighter
#E0E7FF
Indigo-100

Usage:

  • Primary actions (buttons, links)
  • Active states
  • Focus indicators
  • Important UI elements
typescript
import { tokens } from 'ds-bridge/tokens';

const color = tokens.colors.primary; // '#6366F1'

Secondary

secondary
#EC4899
Pink-500
secondaryDark
#DB2777
Pink-600
secondaryLight
#F472B6
Pink-300

Usage:

  • Secondary actions
  • Accent elements
  • Highlights and badges
  • Complementary UI elements

Semantic Colors

Semantic colors convey meaning and status.

Error

error
#DC2626
Red-600
errorLight
#FEE2E2
Red-100

Usage: Error messages, destructive actions, validation failures

Warning

warning
#F59E0B
Amber-500
warningLight
#FEF3C7
Amber-100

Usage: Warnings, caution alerts, important notices

Success

success
#10B981
Emerald-500
successLight
#D1FAE5
Emerald-100

Usage: Success messages, confirmations, positive feedback

Info

info
#3B82F6
Blue-500
infoLight
#DBEAFE
Blue-100

Usage: Informational messages, tips, help text

Surface Colors

Surface colors define the backgrounds and containers in your UI.

surface
#FFFFFF
White
surfaceVariant
#F3F4F6
Gray-100
surfaceHover
#F9FAFB
Gray-50

Usage:

  • Card backgrounds
  • Modal backgrounds
  • Hover states
  • Elevated elements

Text Colors

Text colors provide hierarchy and readability.

87% Opacity
textHigh
#111827
Primary text
60% Opacity
textMedium
#6B7280
Secondary text
38% Opacity
textLow
#D1D5DB
Disabled/Placeholder
White
textInverse
#FFFFFF
Text on dark

Text Hierarchy:

  • High emphasis (87%): Headings, primary content
  • Medium emphasis (60%): Body text, descriptions
  • Low emphasis (38%): Placeholder text, disabled states
  • Inverse: Text on dark backgrounds

Neutral Colors

Neutral colors for borders, dividers, and subtle UI elements.

neutral
#6B7280
Gray-500
neutralLight
#E5E7EB
Gray-200
neutralDark
#374151
Gray-700

Usage Examples

In Components

vue
<template>
  <div :style="containerStyles">
    <h2 :style="headingStyles">Title</h2>
    <p :style="textStyles">Description text</p>
  </div>
</template>

<script setup>
import { tokens } from 'ds-bridge/tokens';
import { computed } from 'vue';

const containerStyles = computed(() => ({
  backgroundColor: tokens.colors.surface,
  borderRadius: tokens.borderRadius.md,
  padding: tokens.spacing.lg,
}));

const headingStyles = computed(() => ({
  color: tokens.colors.textHigh,
}));

const textStyles = computed(() => ({
  color: tokens.colors.textMedium,
}));
</script>

With Semantic Meaning

vue
<!-- Error state -->
<div :style="{
  backgroundColor: tokens.colors.errorLight,
  color: tokens.colors.error,
  padding: tokens.spacing.md,
  borderRadius: tokens.borderRadius.sm
}">
  Error: Please check your input
</div>

<!-- Success state -->
<div :style="{
  backgroundColor: tokens.colors.successLight,
  color: tokens.colors.success,
  padding: tokens.spacing.md,
  borderRadius: tokens.borderRadius.sm
}">
  Success: Changes saved!
</div>

Accessibility

All color combinations in DS-Bridge meet WCAG 2.1 AAA standards:

Contrast Ratios

CombinationRatioWCAG AAA
primary on white7.2:1✅ Pass
textHigh on surface15.8:1✅ Pass
textMedium on surface4.6:1✅ Pass
error on white6.7:1✅ Pass
success on white4.5:1✅ Pass

Best Practices

DO:

  • Use textHigh for headings and important content
  • Use textMedium for body text
  • Use semantic colors (error, success) for status messages
  • Ensure sufficient contrast between text and backgrounds

DON'T:

  • Use textLow for important information
  • Place light text on light backgrounds
  • Rely solely on color to convey meaning (add icons/text)
  • Use color combinations not defined in the tokens

Dark Mode

DS-Bridge includes dark mode variants (coming soon):

typescript
// Dark mode color tokens
dark: {
  background: '#1F2937',
  surface: '#374151',
  textHigh: '#F9FAFB',
  textMedium: '#D1D5DB',
  // ... other dark mode colors
}

Customization

To customize colors for your brand:

  1. Edit src/tokens/index.ts:
typescript
export const colors = {
  primary: '#YOUR_PRIMARY_COLOR',
  secondary: '#YOUR_SECONDARY_COLOR',
  // ... other colors
};
  1. Rebuild the library:
bash
npm run build
  1. Update Figma variables to match (optional)

Learn More


Questions about colors? Check out the style guide for usage patterns.

Built with Vue 3, Vuetify 3, and TypeScript