Robin Malfait 7920850728
Temporarily remove optional chaining in nesting plugin (#7077)
* remove optional chaining

This breaks on Node versions lower than version 13. Normally we
transpile everything, but we currently don't do this for the nesting
plugin since it is not really part of the `src` folder.

Will get this fixed in a better way, but for now this is a quick fix to
get everything working again!

* update changelog
2022-01-15 02:36:34 +01:00
..
2021-09-01 17:13:59 +02:00
2021-09-01 17:13:59 +02:00

tailwindcss/nesting

This is a PostCSS plugin that wraps postcss-nested or postcss-nesting and acts as a compatibility layer to make sure your nesting plugin of choice properly understands Tailwind's custom syntax like @apply and @screen.

Add it to your PostCSS configuration, somewhere before Tailwind itself:

// postcss.config.js
module.exports = {
  plugins: [
    require('postcss-import'),
    require('tailwindcss/nesting'),
    require('tailwindcss'),
    require('autoprefixer'),
  ]
}

By default, it uses the postcss-nested plugin under the hood, which uses a Sass-like syntax and is the plugin that powers nesting support in the Tailwind CSS plugin API.

If you'd rather use postcss-nesting (which is based on the work-in-progress CSS Nesting specification), first install the plugin alongside:

npm install postcss-nesting

Then pass the plugin itself as an argument to tailwindcss/nesting in your PostCSS configuration:

// postcss.config.js
module.exports = {
  plugins: [
    require('postcss-import'),
    require('tailwindcss/nesting')(require('postcss-nesting')),
    require('tailwindcss'),
    require('autoprefixer'),
  ]
}

This can also be helpful if for whatever reason you need to use a very specific version of postcss-nested and want to override the version we bundle with tailwindcss/nesting itself.