nuxt-modules / tailwindcss

Tailwind CSS module for Nuxt
https://tailwindcss.nuxtjs.org
MIT License
1.6k stars 180 forks source link

How to encrypt tailwind classes? #831

Closed JenuelDev closed 1 month ago

JenuelDev commented 1 month ago

So Ive seen websites with anusual class name, and I came to learn that their class are encrypted or should I say hashed.

example:

class="1m8df4t jhou34 fMdyDu"

How to do something like this on nuxt tailwind module? thanks :)

ineshbose commented 1 month ago

Hey 👋 Thanks for opening an issue on this repository.

Yes, there would be websites that hash/obfuscate their classnames, and while this would normally be in their production build, it's likely not a TailwindCSS principle and there's lot of community discussion/solutions around it. For this module, we have #240 open as we work on what's possible and what's not. For the websites you've seen, it depends on their tech stack and they may have internal tools on this that specifically works with their project. In Vue/Vite, you may be able to use CSS Modules that has hashing in the class names, along with the styles being scoped for the most part - but again, this isn't the Tailwind way. We're trying to see what we can do with unplugin to develop a solution; again, keep an eye on #240. Closing this as duplicate!