Theming Guide
Customize Helper's appearance using the globals.css-based theming system
This application uses a globals.css-based theming system. All theme customizations should be made directly in the app/globals.css
file.
Architecture
The theming system is built on CSS custom properties (variables) and supports:
- Light/Dark mode switching via
next-themes
- Static theme definitions in globals.css
- Tailwind CSS v4 integration with CSS variables
Theme Structure
Base Theme Variables
The application defines CSS variables in app/globals.css
for both light and dark modes:
Variable Categories
-
Layout Colors
--background
- Main background color--foreground
- Primary text color--card
- Card background--border
- Border color
-
Interactive Colors
--primary
- Primary button/link color--secondary
- Secondary button color--accent
- Accent/hover color--destructive
- Error/danger color--success
- Success color
-
Sidebar Colors
--sidebar-background
- Sidebar background--sidebar-foreground
- Sidebar text--sidebar-accent
- Sidebar hover state
-
Chart Colors
--chart-1
through--chart-5
- Data visualization colors
Adding Custom Themes
To create a custom theme, add a new CSS class in globals.css
:
Then apply the theme class to the root element or specific components.
AI-Based Theme Updates
To update themes using AI, modify the CSS variables in app/globals.css
:
- Identify the theme section you want to modify (
:root
,.light
,.dark
, or custom theme classes) - Update the HEX values for the desired variables
- Test the changes by applying the theme class
- Ensure proper contrast ratios for accessibility
Example AI Prompts for Theme Changes
Design System Compliance:
Brand-Specific Theming:
Accessibility-First Approach:
Color Guidelines
- Use HEX color format for better readability and manipulation
- Maintain sufficient contrast ratios (4.5:1 for normal text, 3:1 for large text)
- Test themes in both light and dark modes
- Consider accessibility for users with visual impairments
Tailwind Integration
The theme variables are automatically available in Tailwind CSS classes: