-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
Support multi-value radii and spacing tokens #110
Comments
Just so I understand correctly: You'd like to be able to create a token that defines each corner independently? Because right now you can set tokens on individual corners by right-clicking a borderRadius token and then choosing which corners to apply it on (you can mix tokens). I think introducing the option to combine these definitely makes sense (think certain shapes that always appear in a certain combination of radii). if we introduced these combination tokens, I agree we should stay close to what you can do in css right now:
|
Yes. As far as I know, is not possible to set values for the two top or bottom corners, for example. It would be great if we could set the border radius like CSS does:
|
I like it! So in addition to users being able to completely set border radii as they can do now, we'd allow multi-value tokens for borderRadii. When applying a token, we'd just check if that token is a single-value token or a multi-value token, then we'd know where to apply it to. Multi-value tokens shouldn't be allowed to be set on individual corners though, so the plugin showing that token would have to have some sort of logic to differentiate between the two, and thus disabling the other options. So when a user right-clicks a multi-value token, the following from this screenshot should be disabled:
|
I like it! |
What would this multi-value tokens look like in the JSON code? I want to communicate the figma design intent (i.e. different radii on each corner) to the development team through the token. If a best practice already exists for this use case please can someone tell me how? Should I set up aliases for a token for each corner? |
I guess simple CSS like string should work as well:
https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius |
We'll move forward with this: Radius, Spacing tokens can be:
When right-clicking such a token, the individual side entries are disabled, only the |
We are using it as a string right now in dev. And it works great. |
The syntax I think should be optional in the settings, but not sure. |
Any updates on this one? Be a great one to have as it could be used as a basic concept of a branded shape token. |
The day has come! 👀 This was shipped as part of V123 🎉 More info here: https://docs.figmatokens.com/available-tokens/spacing-tokens#multi-value-spacing-tokens |
Description
In addition to users being able to completely set border radii as they can do now, we'd allow multi-value tokens for borderRadii.
When applying a token, we'd just check if that token is a single-value token or a multi-value token, then we'd know where to apply it to.
Multi-value tokens shouldn't be allowed to be set on individual corners though, so the plugin showing that token would have to have some sort of logic to differentiate between the two, and thus disabling the other options.
Radius, Spacing tokens can be:
Requirements
All
option is present.Gap
toAll
.Initial description
Think in a way to allow to set multiple
boderRadius
values inline in order to have a different radius for each corner (like CSS does).The text was updated successfully, but these errors were encountered: