unocss / unocss

The instant on-demand atomic CSS engine.
https://unocss.dev
MIT License
16.27k stars 817 forks source link

unocss/postcss Using `@container (theme('containers.sm'))` is not compiled correctly using unocss/vite #3999

Open minht11 opened 1 month ago

minht11 commented 1 month ago

UnoCSS version

0.61.5

Describe the bug

When using unocss/vite following code is not compiled correctly:

@container (theme('containers.sm')) {
        body {
            background-color: red;
        }
    }

In css output theme('containers.sm') is left untouched. Interestingly using @unocss/svelte-scoped/vite works as expected.

Reproduction

Compile code above using unocss/postcss and see output.

System Info

Svelte 5.0

Validations

minht11 commented 1 month ago

I am actually not sure if it is postcss related or https://unocss.dev/transformers/directives