Skeleton provides guardrails and utilities to help you craft your custom color system. This includes a number of colors, shades, and contrast values that work together seamlessly. Providing a visually appealing and accessible palette for each theme.
Color Palette
Supports all Tailwind color utility classes using the following pattern.
{property}-{color}-{shade}| Key | Accepted Values |
|---|---|
| Property | accent, bg, border, caret, decoration, divide, fill, outline, ring, shadow, stroke, text |
| Color | primary, secondary, tertiary, success, warning, error, surface |
| Shade | 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950 |
<div class="bg-primary-500">...</div>
<div class="border border-secondary-600">...</div>
<svg class="fill-surface-950">...</svg>Contrast Colors
Test the following with different themes and dark mode combinations.
Direct Use
Presets
Preset + Pairings
Contrast color values are available for every shade in the color ramp. Use these to set accessible text color and icon fill values. You may also refer to the Preset system for utility classes that automatically mix each color and contrast tone.
{property}-{color}-contrast-{shade}Color Pairings
A visual preview of each pairing.
Brand
Toggle dark mode and monitor the dynamic reaction.
Provides a condensed syntax for dual-tone color values, evenly balanced to swap between light and dark mode. Pairings are supported for all Tailwind utility color classes (bg, border, fill, etc).
{property}-{color}-{lightModeShade}-{darkModeShade}<div class="bg-surface-200-800">...</div>
<div class="border border-secondary-400-600">...</div>
<svg class="fill-secondary-50-950">...</svg>How Pairings Work
Color Pairing are enabled through the use of the CSS light-dark function. This means instead of writing the standard light/dark syntax with Tailwind utilities:
<div class="text-primary-300 dark:text-primary-700">...</div>You can instead use a much more condensed syntax:
<div class="text-primary-300-700">...</div>This will then be implemented into your CSS bundle as follows:
.text-primary-300-700 {
color: light-dark(var(--color-primary-300), var(--color-primary-700));
}Plus, as a benefit to using the CSS light-dark() function, this also enables use of Tailwind’s Color Scheme utilities. Learn more about using Color Scheme .
When to Use Pairings
Color Parings are useful for generating a hierarchy of visual layers, ranging from foreground to background elements. Each reuse the same color ramp, but invert the order when switching from light to dark mode.
- We can use shade
950for light mode and50from dark mode to represent our body text color. - Then use shade
50from light mode and950from dark mode to represent our app background. - Use the static
500shade for key branding elements, such as buttons or banners. - Then reserve multiple layers between for elements such as cards, inputs, and more.
Brand Color
A variable accent color for your design system. Use this as the default when styling elements and components.
TIP: The Nouveau theme makes use of variable brand color for light and dark modes.
Benefits
- Brand can use any colors from your palette (ex: primary/secondary/tertiary)
- Brand supports the use of custom colors.
- Brand can use any shade from 50-950; not just limited to shade 500.
- Brand color/shade can be tailored for light and dark mode independently.
- Brand includes a contrast color for foreground elements.
- Brand supports all standard presets, ex:
preset-filled-brand.
Transparency
All available Skeleton Colors and Color Pairings support Tailwind’s color transparency syntax.
<div class="bg-primary-500/25">Primary Color @ 25% transparency</div>
<div class="bg-surface-50-950/60">Surface Pairing 50/950 @ 60% transparency</div>Core API
For more information on theme properties, please refer to the Core API documentation.