Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Disable Preflight in Tailwind v4 (Docusaurus) #17867

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mkosir opened this issue May 4, 2025 · 0 comments
Closed

Disable Preflight in Tailwind v4 (Docusaurus) #17867

mkosir opened this issue May 4, 2025 · 0 comments

Comments

@mkosir
Copy link

mkosir commented May 4, 2025

What version of Tailwind CSS are you using?

v4.1.5 (latest)

What build tool (or framework if it abstracts the build tool) are you using?

Docusaurus 3.7

What version of Node.js are you using?

v22.15.0

What browser are you using?

Chrome

What operating system are you using?

macOS

Reproduction URL

See the styling of the Rule and Note buttons in the production build:

Image

https://mkosir.github.io/typescript-style-guide/#array-types

Now run the same project locally (cd website && npm run start) and the buttons look correct

Image

http://localhost:3000/typescript-style-guide/#array-types

Describe your issue

In Tailwind v3, I disabled Preflight in tailwind.config.ts:

corePlugins: {
    preflight: false, // disable Tailwind's reset -  don't wipe out the rest of Docusaurus styles
  },

This worked perfectly.

In Tailwind v4, I followed the docs and tried disabling Preflight via CSS (here) but the production build doesn’t behave the same as local dev—the button styles break in production.

Probably I'm missing something to correctly disable Preflight and apply custom css afterwards.

Thanks for any guidance!

@wongjn wongjn converted this issue into discussion #17868 May 4, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant