--- id: slds.guidance.utilities.themes title: Themes Utilities description: SLDS theme utility classes for background and text colors summary: "Utilities for applying color themes including default, shade, inverse, and semantic states (success, info, warning, error, offline)." artifact_type: reference domain: utilities topic: themes content_format: structured complexity: intermediate audience: [implementer] tasks: [implement] refs: - slds.guidance.utilities - slds.guidance.overview.utilities - slds.guidance.hooks.color tags: [utilities, themes, colors, backgrounds] keywords: [slds-theme, background colors, semantic colors, inverse themes] --- # Themes - Color & Background Applying consistent color themes to containers and components. ## Core Classes | Class | Purpose | |-------|---------| | `slds-theme_default` | White background with default text color | | `slds-theme_shade` | Gray background (#F3F3F3) for subtle contrast | | `slds-theme_inverse` | Dark blue background with white text | | `slds-theme_alt-inverse` | Darker blue background variant | ## Semantic State Themes | Class | Background Color | Text Color | |-------|-----------------|------------| | `slds-theme_success` | Green (#4BCA81) | White | | `slds-theme_info` | Gray-blue (#706E6B) | White | | `slds-theme_warning` | Yellow (#FFB75D) | Black | | `slds-theme_error` | Red (#EA001E) | White | | `slds-theme_offline` | Black (#444) | White | ## Texture Modifier | Class | Purpose | |-------|---------| | `slds-theme_alert-texture` | Adds diagonal striped pattern overlay | ## Common Patterns ```html
Default themed card
Card content with white background

Section Title

Content on subtle gray background

... Operation completed successfully
Warning: This action cannot be undone

Dashboard

All text and links are automatically styled for dark backgrounds

``` ## Best Practices ✅ Use `slds-theme_default` for standard white backgrounds ✅ Apply `slds-theme_shade` to visually separate sections ✅ Use semantic themes (success, error, warning) for status messages ✅ Combine `slds-theme_alert-texture` with semantic themes for critical alerts ✅ Apply themes to container elements, not individual text elements ✅ Use `slds-theme_inverse` for headers and navigation areas ❌ Nest multiple theme classes on the same element ❌ Override theme colors with inline styles ❌ Use semantic themes for decorative purposes ❌ Apply themes to elements smaller than 44×44px touch targets ## Deprecation Notes The following double-dash variants are deprecated but still supported: - `slds-theme--default` → Use `slds-theme_default` - `slds-theme--shade` → Use `slds-theme_shade` - `slds-theme--inverse` → Use `slds-theme_inverse` - `slds-theme--alt-inverse` → Use `slds-theme_alt-inverse` - `slds-theme--success` → Use `slds-theme_success` - `slds-theme--info` → Use `slds-theme_info` - `slds-theme--warning` → Use `slds-theme_warning` - `slds-theme--error` → Use `slds-theme_error` - `slds-theme--offline` → Use `slds-theme_offline` - `slds-theme--alert-texture` → Use `slds-theme_alert-texture` - `slds-theme--inverse-text` → Use `slds-theme_inverse-text`