unocss / unocss

The instant on-demand atomic CSS engine.

Home Page:https://unocss.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

With nuxt, if using a standalone configuration `uno.config.ts`, the class `space-{direction}-{number}` is incorrectly generated

leo91000 opened this issue · comments

I have a weird issue with unocss & nuxt & css class space-{direction}-{number}. The class is not applied and the generated css seems wrong :

.space-y-3 > :not([hidden]) ~ :not([hidden]) > :not([hidden]) ~ :not([hidden]) {
    --un-space-y-reverse: 0;
    margin-bottom: calc(.75rem * var(--un-space-y-reverse));
    margin-top: calc(.75rem * (1 - var(--un-space-y-reverse)))
}

The var --un-space-y-reverse is set to 0 where it should be 3

Here a very simple stackblitz repro : https://stackblitz.com/edit/github-xishze-ftqdny?file=app.vue,uno.config.ts

If you delete presetUno() from uno.config.ts or define uno: false in nuxt.config.ts it will work. Because presetUno already enabled by default and loading it twice will cause some issues.

If you delete presetUno() from uno.config.ts or define uno: false in nuxt.config.ts it will work. Because presetUno already enabled by default and loading it twice will cause some issues.

Thanks, that was it !