Customization
Colors & Theme
This documentation is for the preview version of the Dev Portal. If you are not part of the preview program, please refer to the current Dev Portal docs.
Colors
You can customize the theme colors for both light and dark modes. Colors can be specified using hex values (which will be automatically converted to HSL) or direct HSL values.
const config = { theme: { light: { background: "#ffffff", foreground: "#020817", card: "#ffffff", cardForeground: "#020817", popover: "#ffffff", popoverForeground: "#020817", primary: "#0284c7", primaryForeground: "#ffffff", secondary: "#f1f5f9", secondaryForeground: "#020817", muted: "#f1f5f9", mutedForeground: "#64748b", accent: "#f1f5f9", accentForeground: "#020817", destructive: "#ef4444", destructiveForeground: "#ffffff", border: "#e2e8f0", input: "#e2e8f0", ring: "#0284c7", }, dark: { // Dark mode colors... }, }, };typescript
Radius
The radius
property is used to set the border radius for the theme. It can be a single and all radii will be inherited from that value.
export default { theme: { dark: { // other theme variables... radius: "0.5rem", }, light: { radius: "0.5rem", }, }, };typescript
or to make sure the radius is the same for both light and dark modes you can use a variable:
const radius = "0.5rem"; export default { theme: { dark: { radius, }, light: { radius, }, }, };typescript
Available Theme Variables
background
- Main background colorforeground
- Main text colorcard
- Card background colorcardForeground
- Card text colorpopover
- Popover background colorpopoverForeground
- Popover text colorprimary
- Primary action colorprimaryForeground
- Text color on primary backgroundssecondary
- Secondary action colorsecondaryForeground
- Text color on secondary backgroundsmuted
- Muted/subtle background colormutedForeground
- Text color for muted elementsaccent
- Accent color for highlightsaccentForeground
- Text color on accent backgroundsdestructive
- Color for destructive actionsdestructiveForeground
- Text color on destructive backgroundsborder
- Border colorinput
- Input field border colorring
- Focus ring colorradius
- Border radius value