unocss / unocss

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

`transformerDirectives` doesn't work with lightningcss. #2910

Closed MrFoxPro closed 1 year ago

MrFoxPro commented 1 year ago

UnoCSS version

0.53.6

Describe the bug

Error when using @apply at css and setting css.transformer = 'lighningcss' in Vite

8:26:31 PM [vite] Internal server error: Unknown at rule: @apply
  Plugin: vite:css
  File: /@toad/home/foxpro/craft/sferadel/next/web/core/app.scss:18:13
  16 |     }
  17 |     body {
  18 |        @apply dark:(bg-gray-900 color-white-000);
     |               ^
  19 |     }
  20 |  

Reproduction

https://github.com/MrFoxPro/unocss-directives-lighningcss

System Info

No response

Validations

zoeyzhao19 commented 1 year ago

@appy is support by other css pre-processors or css language, but not lightingcss (I don't know much about lightingcss, but this may help). You can change to --at-apply as the document said