[V4] Defaults for --value() and --modifier()? #18030
katerlouis
started this conversation in
Ideas
Replies: 1 comment
-
|
@katerlouis did you figure out how i can provider default value for --value or any workarounds? --wiggle-degrees: calc(--value(integer, 100) * 1deg); |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
Imagine the following utility:
.atl=position: absolute; top: 0; left: 0, so far so good.atl-5= as above with spacing variables for top and left.atl-5/10= same as above but left has spacing10instead of5This
@utility-declaration works perfect foratlandatl-5, as the secondleft:assignment is just dropped due to no modifier being present.With a modifier present, however, the output css features 2
left-assignments. This works functionally as the secondleftoverwrites the firstleft, but the double assignment is bugging me.What about a way to assign default values to
--value()and--modifier()in case they are not present.This would for one allow
atl(without value nor modifier) to default to a desired value, and also allow only oneleftassignment in this example.Ideally defaults could be nested like so:
left: --spacing(--modifier(number, --value(number, 0)))Ideally tailwind would be smart enough to recognize, that if there are defaults present for
--value, that I don't need to declare a separate@utility atljust for the default-version. Seems like not much of a burden, until you need a lot of utilities with fallbacks. In this example I also want combinations forbottomandrightas well, and of course also forfixed.atl, abl, atr, atl, ftl, fbl, ftr, fbr
alongside their
-*valued version.What do you think?
Beta Was this translation helpful? Give feedback.
All reactions