Overview
The Trails widget is fully customizable through CSS variables, allowing you to match your brand and design system. You can customize colors, typography, spacing, border radius, shadows, and more.CSS Variable Reference
Typography
| Variable | Description | Default Value |
|---|---|---|
--trails-font-family | Font family for all text | ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif |
Border Radius
| Variable | Description | Default Value |
|---|---|---|
--trails-border-radius-widget | Main widget container | 32px |
--trails-border-radius-button | Primary buttons | 24px |
--trails-border-radius-input | Input fields | 24px |
--trails-border-radius-dropdown | Dropdown menus | 12px |
--trails-border-radius-container | Generic containers | 8px |
--trails-border-radius-list | Token lists | 8px |
--trails-border-radius-list-button | List item buttons | 12px |
--trails-border-radius-large-button | Large action buttons | 16px |
Widget Structure
| Variable | Description | Default Value |
|---|---|---|
--trails-widget-border | Main widget border | none |
--trails-shadow | Widget shadow | 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1) |
Primary Colors
| Variable | Description | Default Value |
|---|---|---|
--trails-primary | Primary brand color | rgb(59 130 246) |
--trails-primary-hover | Primary hover state | rgb(37 99 235) |
--trails-primary-disabled | Disabled primary elements | rgb(209 213 219) |
--trails-primary-disabled-text | Disabled text color | rgb(107 114 128) |
Background Colors
| Variable | Description | Default Value |
|---|---|---|
--trails-bg-primary | Main background | rgb(255 255 255) |
--trails-bg-secondary | Secondary background | rgb(249 250 251) |
--trails-bg-tertiary | Tertiary background | rgb(243 244 246) |
--trails-bg-card | Card backgrounds | rgb(255 255 255) |
--trails-bg-overlay | Modal overlays | rgb(255 255 255) |
Text Colors
| Variable | Description | Default Value |
|---|---|---|
--trails-text-primary | Primary text | rgb(17 24 39) |
--trails-text-secondary | Secondary text | rgb(75 85 99) |
--trails-text-tertiary | Tertiary text | rgb(107 114 128) |
--trails-text-muted | Muted text | rgb(156 163 175) |
--trails-text-inverse | Inverse text (on dark backgrounds) | rgb(255 255 255) |
Border Colors
| Variable | Description | Default Value |
|---|---|---|
--trails-border-primary | Primary borders | rgb(229 231 235) |
--trails-border-secondary | Secondary borders | rgb(209 213 219) |
--trails-border-tertiary | Tertiary borders | rgb(243 244 246) |
Interactive States
| Variable | Description | Default Value |
|---|---|---|
--trails-hover-bg | Hover background | rgb(243 244 246) |
--trails-hover-text | Hover text color | rgb(17 24 39) |
--trails-focus-ring | Focus ring color | rgb(59 130 246) |
Status Colors
| Variable | Description | Default Value |
|---|---|---|
--trails-success-bg | Success background | rgb(240 253 244) |
--trails-success-text | Success text | rgb(22 163 74) |
--trails-success-border | Success border | rgb(187 247 208) |
--trails-warning-bg | Warning background | rgb(255 251 235) |
--trails-warning-text | Warning text | rgb(217 119 6) |
--trails-warning-border | Warning border | rgb(253 230 138) |
--trails-error-bg | Error background | rgb(254 242 242) |
--trails-error-text | Error text | rgb(220 38 38) |
--trails-error-border | Error border | rgb(254 202 202) |
Input Fields
| Variable | Description | Default Value |
|---|---|---|
--trails-input-bg | Input background | rgb(255 255 255) |
--trails-input-border | Input border | rgb(209 213 219) |
--trails-input-text | Input text color | rgb(17 24 39) |
--trails-input-placeholder | Placeholder text | rgb(156 163 175) |
--trails-input-focus-border | Focus border color | rgb(59 130 246) |
--trails-input-focus-ring | Focus ring color | rgb(59 130 246) |
Dropdowns
| Variable | Description | Default Value |
|---|---|---|
--trails-dropdown-bg | Dropdown background | rgb(255 255 255) |
--trails-dropdown-border | Dropdown border | rgb(229 231 235) |
--trails-dropdown-text | Dropdown text | rgb(17 24 39) |
--trails-dropdown-hover-bg | Dropdown item hover | rgb(249 250 251) |
--trails-dropdown-selected-bg | Selected item background | rgb(243 244 246) |
--trails-dropdown-selected-text | Selected item text | rgb(17 24 39) |
--trails-dropdown-focus-border | Dropdown focus border | rgb(59 130 246) |
Lists
| Variable | Description | Default Value |
|---|---|---|
--trails-list-bg | List background | rgb(255 255 255) |
--trails-list-border | List border | rgb(229 231 235) |
--trails-list-hover-bg | List item hover | rgb(249 250 251) |
Typography Customization
Custom Fonts
Monospace Theme
Border Radius Customization
Rounded Theme
Square Theme
Advanced Customization
Custom Shadows
Glassmorphism Effect
Best Practices
1. Maintain Accessibility
Ensure sufficient color contrast between text and backgrounds:2. Consistent Border Radius
Use a consistent border radius scale:3. Brand Alignment
Match your existing design system:4. Test in Both Light and Dark Modes
Consider how your customizations work with thetheme prop: