Sugarcoat is configured through a sugarcoat.config.ts file in your project root. This file defines your theme, colors, and other design system settings.
Basic Configuration#
Theme Options#
brandColor#
Your primary brand color used for buttons, links, and primary actions.
Available colors:
tomato, red, ruby, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, teal, jade, green, grass, bronze, gold, brown, orange, amber, yellow, lime, mint, sky
accentColor#
A secondary color for accents and highlights.
Accepts the same color options as brandColor.
grayColor#
The neutral gray scale used for text, borders, and backgrounds.
Available gray scales:
| Scale | Description |
|---|---|
gray | Pure neutral gray |
slate | Cool gray with blue tint |
mauve | Gray with purple tint |
sage | Gray with green tint |
olive | Gray with yellow-green tint |
sand | Warm gray with brown tint |
borderRadius#
The default border radius scale for components.
Available options:
| Value | Description |
|---|---|
none | No border radius (0px) |
sm | Small radius |
md | Medium radius |
lg | Large radius |
xl | Extra large radius |
full | Fully rounded (pill shape) |
additionalColors#
Include extra colors beyond brand/accent/gray.
Other Options#
include#
Files to scan for CSS class extraction.
prefix#
CSS class prefix for generated styles.
importMap#
The import alias for generated CSS utilities.
This allows you to import like:
outdir#
Output directory for generated files.
panda#
Advanced Panda CSS configuration overrides.
Full Example#
Generated Files#
After running sugarcoat codegen, your configuration generates:
Using Generated Utilities#
CSS Function#
Design Tokens#
Recipes#
TypeScript Configuration#
Ensure your tsconfig.json includes the path alias:
Regenerating After Config Changes#
After modifying sugarcoat.config.ts, regenerate the CSS artifacts:
Or keep it running in watch mode during development: