-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Disallow negative bare values #14453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
RobinMalfait
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice I like it. There are still situations where a negative value makes sense e.g.: -z-10, but then -z-10 should be used instead of z--10.
For utilities with fractions, even if negatives make sense then you can always fallback to an arbitrary value.
|
@RobinMalfait Yep, agree. Double |
593f58a to
0102c81
Compare
|
haha hi again @philipp-spiess 👋 I just upgraded from This is for a gradient stop percentage value. Is this also another class that is not allowed any longer? (also: maybe this change was not related to this PR but another one instead...? 🤔) |
|
@karlhorky Hey! Yeah we unfortunately had a bunch of places where we supported decimal places unknowingly. These transition breakpoints were one of those. This was never intended to work but sneaked in because we had an inconsistency in the way we interpret these values. For anything that is not a whole integer, the idea is that you use arbitrary values. So in your case you can use |
|
Ok thanks! I'll switch to arbitrary values for now, and in future, consider using integer percentages. |
Right now, it is possible to type
grid-cols--8which maps to:This doesn't make sense so we used this opportunity to audit all variants and utilities and properly disallow negative bare values. Utilities where negative values are supported still work by using the negative utility syntax, e.g.:
-inset-4.