I have a Next.js app that uses Tailwind. I want to load a third party document viewer that has it’s own styles and there’s a clash between this viewer and Tailwind styles.
Is there a way to avoid the naming clash?
One way is using iframes, but I would like to avoid it.
I know that I could prefix the Tailwind classes, but I would need to rename all classes in all files right? If this is the case, then it’s not an option.
2
Answers
The solution I used was to load the document viewer into an Iframe, this way there was no clash of styles classes.
You can use this TailwindCSS plugin called arthurdenner/tailwindcss-all.
tailwind.config.js
.div
with class ofall-initial
.Refer here for a quick preview.