Native Class Name Obfuscation/Hashing for Production Builds (V4) #19472
AayushBharti
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I am writing to propose a feature for a native option to obfuscate or hash utility class names in production builds (e.g., transforming
.flex .w-full .items-centerto.a .b .cor atomic hashes).Currently, Tailwind CSS compiles to human-readable utility classes that remain in the final HTML. While this is excellent for debugging, it presents a significant drawback regarding Intellectual Property protection.
The Problem
Unlike CSS Modules, Styled Components, or other CSS-in-JS solutions which often hash class names by default (e.g.,
.Button_root__1y2z3), Tailwind exposes the exact styling logic directly in the DOM.relative flex h-screen bg-slate-900) serve as a complete design blueprint.Commercial Precedent & Pro Components
There is a critical need for this feature among vendors of "Pro" components and UI kits.
Benefits
a,b,_x9) makes reverse-engineering designs significantly harder and deters casual copycats.justify-between items-center text-slate-500with short identifiers can noticeably reduce the raw HTML size, improving initial load times and parsing speed.Additional Context
I understand this introduces complexity regarding how the class names in JS/TSX files are mapped to the generated CSS. However, given the rising popularity of Tailwind in enterprise and commercial environments, the ability to "lock down" the source code is becoming a critical business requirement.
Thank you for considering this addition to the framework.
Beta Was this translation helpful? Give feedback.
All reactions