next.jsobfuscationswc

Instagram-like CSS class names obfuscation for NextJS 14 with SWC


I noticed that Instagram Direct often use Tailwind CSS for class names. But somehow they managed to transform it to non-readable format (obfuscation), so people could not run bots for content crawling. I Googled many solutions, but seems like such feature is not requested by wide audience.

Did somebody managed to achieve similar result with Tailwind CSS in NextJS 14 with SWC? Would be glad if you share your solution. It would be preferable if the solution doesn't negatively affect runtime performance. Instagram Direct obfuscated class names


Solution

  • They don't use TailwindCSS at all, they use StyleX.

    Classes that start with x come from here: Low-cost Abstractions