Skip to content

How to configure postcss autoprefixer and stitches in a NEXTJS project? #1024

Discussion options

You must be logged in to vote

You can configure postcss and its features such as autoprefixer etc. But keep in mind that Stitches is currently only a runtime, which means postcss can only handle styles from already mounted components (conditional rendering is not supported) and only at build time. In dev mode - on initial SSR request (hot reload will reset styles without postcss processing).
Things like flex gap polyfill are difficult to implement (for example, it requires a special additional layout).

_document.tsx:

import React from 'react';
import postCss, { AcceptedPlugin } from 'postcss';
import postCssPresetEnv from 'postcss-preset-env';
import NextDocument, { DocumentContext, Html, Head, Main, NextScript } from '…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@LuisFerreirinhaKK
Comment options

Answer selected by LuisFerreirinhaKK
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants