To compile CSS Grid Layout for IE11, you can place the following comment at the top of your CSS file:
/* autoprefixer grid: autoplace */
You can also enable IE11 support for CSS Grid Layout
in your entire project by configuring autoprefixer with the configuration shown below (collapsed).
See "Customizing Plugins" below for more information.
Click to view the configuration to enable CSS Grid Layout
Warning: When you define a custom PostCSS configuration file, Next.js completely disables the default behavior.
Be sure to manually configure all the features you need compiled, including Autoprefixer.
You also need to install any plugins included in your custom configuration manually, i.e. npm install postcss-flexbugs-fixes postcss-preset-env.
To customize the PostCSS configuration, create a postcss.config.json file in the root of your project.
This is the default configuration used by Next.js:
Good to know: Next.js also allows the file to be named .postcssrc.json, or, to be read from the postcss key in package.json.
It is also possible to configure PostCSS with a postcss.config.js file, which is useful when you want to conditionally include plugins based on environment:
Good to know: Next.js also allows the file to be named .postcssrc.js.
Do not use require() to import the PostCSS Plugins. Plugins must be provided as strings.
Good to know: If your postcss.config.js needs to support other non-Next.js tools in the same project, you must use the interoperable object-based format instead: