Prerequisites
Package version
latest
Tailwind CSS version
v3
Bundler / framework
Vite
What happened?
Hi! I found an issue when using tailwindcss-obfuscator with Tailwind CSS 3.4.13.
Responsive utilities such as md:flex-row are obfuscated correctly, but responsive space-x-* utilities such as md:space-x-2 are not.
Tailwind correctly generates the base space-x-2 rule:
.space-x-2 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-left: calc(.5rem * (1 - var(--tw-space-x-reverse)));
margin-right: calc(.5rem * var(--tw-space-x-reverse));
}
The obfuscator correctly obfuscates other utilities from the same element. For example:
.s-w8c {
flex-direction: column;
}
.s-oe1 {
flex-direction: row;
}
.s-t5f {
display: flex;
}
Expected behavior
md:space-x-2 should be obfuscated just like other responsive utilities.
@media (min-width: 768px) {
.s-xyz > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-left: calc(.5rem * (1 - var(--tw-space-x-reverse)));
margin-right: calc(.5rem * var(--tw-space-x-reverse));
}
}
Environment
Tailwind CSS: 3.4.13
tailwindcss-obfuscator: latest
React
Vite
Expected behavior
md:space-x-2 should be obfuscated just like other responsive utilities.
For example, conceptually:
@media (min-width: 768px) {
.s-xyz > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-left: calc(.5rem * (1 - var(--tw-space-x-reverse)));
margin-right: calc(.5rem * var(--tw-space-x-reverse));
}
}
Minimal reproduction
<div className="flex flex-col gap-4 mb-4 align-middle md:space-x-2 md:flex-row">
<Card className="py-4 md:w-1/2">
...
</Card>
<Card className="py-4 md:w-1/2">
...
</Card>
</div>
Logs / stack traces
Environment
No response
Prerequisites
Package version
latest
Tailwind CSS version
v3
Bundler / framework
Vite
What happened?
Hi! I found an issue when using tailwindcss-obfuscator with Tailwind CSS 3.4.13.
Responsive utilities such as md:flex-row are obfuscated correctly, but responsive space-x-* utilities such as md:space-x-2 are not.
Tailwind correctly generates the base space-x-2 rule:
The obfuscator correctly obfuscates other utilities from the same element. For example:
Expected behavior
md:space-x-2 should be obfuscated just like other responsive utilities.
Environment
Tailwind CSS: 3.4.13
tailwindcss-obfuscator: latest
React
Vite
Expected behavior
md:space-x-2 should be obfuscated just like other responsive utilities.
For example, conceptually:
Minimal reproduction
Logs / stack traces
Environment
No response