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:
- Semantic Naming: Colors are named by purpose (
primary,error) not appearance (blue,red) - Accessibility First: All color combinations meet WCAG 2.1 AAA contrast requirements
- Figma Sync: Colors map 1-to-1 with Figma design variables
Primary Brand Colors
The primary brand colors define your product's identity.
Primary
#6366F1
Indigo-600
#4F46E5
Indigo-700
#818CF8
Indigo-400
#E0E7FF
Indigo-100
Usage:
- Primary actions (buttons, links)
- Active states
- Focus indicators
- Important UI elements
import { tokens } from 'ds-bridge/tokens';
const color = tokens.colors.primary; // '#6366F1'Secondary
#EC4899
Pink-500
#DB2777
Pink-600
#F472B6
Pink-300
Usage:
- Secondary actions
- Accent elements
- Highlights and badges
- Complementary UI elements
Semantic Colors
Semantic colors convey meaning and status.
Error
#DC2626
Red-600
#FEE2E2
Red-100
Usage: Error messages, destructive actions, validation failures
Warning
#F59E0B
Amber-500
#FEF3C7
Amber-100
Usage: Warnings, caution alerts, important notices
Success
#10B981
Emerald-500
#D1FAE5
Emerald-100
Usage: Success messages, confirmations, positive feedback
Info
#3B82F6
Blue-500
#DBEAFE
Blue-100
Usage: Informational messages, tips, help text
Surface Colors
Surface colors define the backgrounds and containers in your UI.
#FFFFFF
White
#F3F4F6
Gray-100
#F9FAFB
Gray-50
Usage:
- Card backgrounds
- Modal backgrounds
- Hover states
- Elevated elements
Text Colors
Text colors provide hierarchy and readability.
#111827
Primary text
#6B7280
Secondary text
#D1D5DB
Disabled/Placeholder
#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.
#6B7280
Gray-500
#E5E7EB
Gray-200
#374151
Gray-700
Usage Examples
In Components
<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
<!-- 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
| Combination | Ratio | WCAG AAA |
|---|---|---|
| primary on white | 7.2:1 | ✅ Pass |
| textHigh on surface | 15.8:1 | ✅ Pass |
| textMedium on surface | 4.6:1 | ✅ Pass |
| error on white | 6.7:1 | ✅ Pass |
| success on white | 4.5:1 | ✅ Pass |
Best Practices
✅ DO:
- Use
textHighfor headings and important content - Use
textMediumfor body text - Use semantic colors (
error,success) for status messages - Ensure sufficient contrast between text and backgrounds
❌ DON'T:
- Use
textLowfor 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):
// Dark mode color tokens
dark: {
background: '#1F2937',
surface: '#374151',
textHigh: '#F9FAFB',
textMedium: '#D1D5DB',
// ... other dark mode colors
}Customization
To customize colors for your brand:
- Edit
src/tokens/index.ts:
export const colors = {
primary: '#YOUR_PRIMARY_COLOR',
secondary: '#YOUR_SECONDARY_COLOR',
// ... other colors
};- Rebuild the library:
npm run build- Update Figma variables to match (optional)
Learn More
- Design Tokens: Complete token reference
- Typography: Type system and fonts
- Spacing: Layout and spacing grid
- Style Guide: Usage guidelines
Questions about colors? Check out the style guide for usage patterns.

