Overview
Control background color with semantic utilities. Background colors help create visual hierarchy, define sections, and establish the overall tone of your design.Background Color Utilities
| Class | Color | Hex | CSS | Usage |
|---|---|---|---|---|
.bg-white | White | #ffffff | background-color: #ffffff; | Light backgrounds |
.bg-black | Black | #000000 | background-color: #000000; | Dark backgrounds |
.bg-gray-dark | Dark Gray | #374151 | background-color: #374151; | Dark sections |
.bg-gray | Gray | #6b7280 | background-color: #6b7280; | Muted backgrounds |
.bg-gray-light | Light Gray | #f3f4f6 | background-color: #f3f4f6; | Subtle backgrounds |
.bg-blue | Blue | #3b82f6 | background-color: #3b82f6; | Primary actions |
.bg-green | Green | #10b981 | background-color: #10b981; | Success states |
.bg-red | Red | #ef4444 | background-color: #ef4444; | Error states |
.bg-yellow | Yellow | #f59e0b | background-color: #f59e0b; | Warning states |
Examples
Common Patterns
Section Backgrounds
Status Backgrounds
Card with Color Accent
Navigation with Color
Color Combinations
High Contrast Combinations
Subtle Combinations
Best Practices
- Use semantic colors: Match background colors to their purpose (green for success, red for errors)
- Maintain contrast: Ensure text is readable on colored backgrounds
- Create hierarchy: Use different background colors to separate sections
- Consider accessibility: Test color combinations for sufficient contrast

