Validate for clashing token names #18982
donaldpipowitch
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Actually, these values can be overridden, but if the override is intentional, the error message can be frustrating. Btw.: https://tailwindcss.com/docs/theme#default-theme-variable-reference |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
We just discovered after a long time of usage that our token naming clashes with internal utilities. We have tokens like this:
The problem is that
rounded-xl
translates toborder-radius: var(--radius-xl)
, butrounded-l
translates toborder-top-left-radius: 0.25rem; border-bottom-left-radius: 0.25rem;
. I guess this is why Tailwind usedlg
internally.We took this naming scheme from our spacing where we also have things like this:
There should be no problems here as we have then classes like
pl-l
.First Request
It would be nice if the Tailwind compiler would error on potential naming conflicts.
Second Request
Maybe long term (for v5?) it would be nice if all top/left/right/bottom modifiers would follow the same schema, so that you would write
roundedl
forborder-top-left-radius: 0.25rem; border-bottom-left-radius: 0.25rem;
androunded-l
works likep-l
.(I admit
roundedl
looks ugly. Maybe it'srl
instead in the future...?)Beta Was this translation helpful? Give feedback.
All reactions