unocss: transformerDirectives and theme not working in nextjs / webpack

UnoCSS version

0.49.4

Describe the bug

I am trying to use transformerDirectives in my nextjs application that uses webpack. The theme is not taking any effect and the transformer directives does not seem to work.

Reproduction

https://stackblitz.com/edit/nextjs-uvg3hv?file=lib%2Fassets%2Fglobal.scss,pages%2Findex.tsx,unocss.config.ts

Look at lib/assets/globals.scss, styles/globals.css, pages/_app.tsx and pages/index.tsx for the classes applied.

In pages/index.tsx I havde added text-red-500 which works like it should, but text-lavender does not work, even though it has been added to the theme in unocss.config.ts.

System Info

Stackblitz and Linux (NixOS)

Validations

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 3
  • Comments: 17 (7 by maintainers)

Most upvoted comments

it doesn’t transform @apply in .scss file.

@jukrb0x This will be fixed with #2338

@sibbng this fix. Can @unocss/postcss use @apply in scss files?

Yes.

Or you can try the latest @unocss/postcss