postcss / postcss-nested

PostCSS plugin to unwrap nested rules like how Sass does it.
MIT License
1.15k stars 66 forks source link

How can I use this with NextJs #143

Closed OhadBaehr closed 2 years ago

OhadBaehr commented 2 years ago
// If you want to use other PostCSS plugins, see the following:
// https://tailwindcss.com/docs/using-with-preprocessors
module.exports = {
  plugins: {
    'postcss-nested':{},
    tailwindcss: {},
    autoprefixer: {},
    'postcss-flexbugs-fixes': {},
    'postcss-preset-env': {
      autoprefixer: {
        flexbox: 'no-2009',
      },
      stage: 3,
      features: {
        'custom-properties': false,
      },
    },
  },
}

Tried this configuration, didn't do much... when I try to write nested classes In styled jsx I get an error

ai commented 2 years ago

You need a special config because of Tailwind CSS https://tailwindcss.com/docs/using-with-preprocessors#nesting