Where Is the UnoCSS Config File?
UnoCSS reads uno.config.ts at the project root for presets, shortcuts, and safelist rules.
Last updated
UnoCSS keeps its setup in uno.config.ts at the project root. Presets, shortcuts, rules, and the safelist all live there in one place. The build plugins discover it automatically, so most projects never pass a path explicitly.
Older guides may reference unocss.config.ts, which still resolves in many versions. Prefer uno.config.ts for new work since current docs use it. Keep the file in version control; generated CSS output stays out of git.
Where UnoCSS stores this, by platform
[ProjectDir]/uno.config.ts
Primary config beside package.json. Presets and shortcuts resolve relative to this file. The legacy unocss.config.ts name may also work by version.
[ProjectDir]/uno.config.ts
Same root file on Mac. Framework plugins pick it up without extra options. Commit it with the rest of the source.
[ProjectDir]\uno.config.ts
Same file on Windows. Import paths inside follow Node resolution from the project root. Exact accepted extensions may vary by release.
Frequently asked questions
Which UnoCSS config wins in a monorepo?
The nearest config walking up from each processed file, which is the root one in most repos. Package level files extend it where needed. One root config keeps atomic classes consistent everywhere.
Do framework plugins use the same file?
Yes. The Vite, Astro, and Nuxt plugins all read uno.config.ts by default, with an explicit configFile option for odd layouts. Terminal builds and editor hints share the file, so results match.
Notice an outdated path? Let us know.