Color Palette
The design system uses a carefully curated color palette designed for accessibility and visual harmony. All colors are defined as CSS custom properties for easy theming and dynamic adjustments.
Primary Colors
Primary
#0066cc
Primary Dark
#0052a3
Primary Light
#e6f0ff
Semantic Colors
| Color | Hex | Usage |
|---|---|---|
| Success | #10b981 | Positive feedback, confirmations |
| Error | #ef4444 | Error messages, destructive actions |
| Warning | #f59e0b | Warnings, caution messages |
| Info | #3b82f6 | Information, help text |
Neutral Grays
The gray scale provides semantic meaning from light to dark:
- Gray 50-100: Backgrounds, subtle elements
- Gray 200-400: Borders, dividers, disabled states
- Gray 500-700: Secondary text, muted content
- Gray 800-900: Primary text, headings
CSS Variables
/* Primary */
--color-primary: #0066cc;
--color-primary-dark: #0052a3;
--color-primary-light: #e6f0ff;
/* Semantic */
--color-success: #10b981;
--color-error: #ef4444;
--color-warning: #f59e0b;
--color-info: #3b82f6;
/* Grays */
--color-gray-50 through --color-gray-900;
Usage
Import the tokens file in your CSS to use these colors:
@import "@milfushi/ui/dist/tokens.css";
.my-element {
color: var(--color-primary);
background-color: var(--color-gray-100);
}
Accessibility
- All color combinations meet WCAG AA contrast requirements
- Colors are not the only means of conveying information
- Semantic colors (success, error, warning) are distinguishable by pattern or shape, not just color