Next JS - How to apply Tailwind to specific pages

Viewed 153

I want to migrate an existing Next JS project to Tailwind CSS.

Is there a way to ensure Tailwind and Preflight/any default style only applies to specific pages? I basically need some pages to remain 100% untouched by Tailwind.

Things I've tried

  • Modifying the content option in tailwind.config (that only affects the classes) and doesn't stop Tailwind applying base styling
  • Applying global.css which has the Tailwind css conditionally (haven't been able to figure out how to do this)
  • Disabling preflight. You can only do this for all pages or none of them
0 Answers
Related