#How can I use postcss-preset-env plugin? Is not working?

6 messages · Page 1 of 1 (latest)

sacred kite
#

Hi! I have a project with tailwind integrated (v 3.0.1) and I'm trying to add the preset-env plugin of postcss but I can't find how to make it work.

I created a postcss.config.js file with this code:

module.exports = {
  plugins: [
    require('postcss-preset-env')({ stage: 0 })
  ]
}

Then I have checked an error I'm having using nesting css (which you can do with preset-env)

[vite:css] Nested CSS was detected, but CSS nesting has not been configured correctly.
Please enable a CSS nesting plugin *before* Tailwind in your configuration.
See how here: https://tailwindcss.com/docs/using-with-preprocessors#nesting

And then I tried to do as they tell:

module.exports = {
  plugins: {
    'postcss-import': {},
    'tailwindcss/nesting': {},
    tailwindcss: {},
    autoprefixer: {},
  }
}

But nothing seems to work. I would love to have the preset-env plugin installed so I can write new CSS code without a problem.

Thanks a lot for your help!

naive locust
#

Hello! I've seen this issue pop up a couple of times, it's probably a bug. I'd suggest submitting a new issue on GH

#

!issue

polar pathBOT
sacred kite
naive locust
#

Thanks!