-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
Drop-shadow values appear in reverse order #111
Comments
Hi! Thanks for informing of the issue. Does this cause visual defects? |
Unless I've missed something, the result is that the order of the shadows is reversed, when implemented using the token from Figmagic. Due to that the Figma API returns them in the reversed order (seen in figma.json). When you use the inspect mode in Figma, the order is as one would expect. The first drop-shadow property (Figma Design mode) is inserted into the box-shadow property declaration first (Figma Inspect mode). Here's an example of a visual defect (reversed order of shadow values in box-shadow). Another problem is that Figma calls everything Drop-shadow, while translating the design into box-shadow or drop-shadow CSS dependent upon whether it's a ~ shape or a vector graphic. See blog post from the Figma developer who built the feature. This means that if Figmagic is used to define shadow tokens, it should be recommended to only have one drop-shadow definition per rectangle. To maintain compatibility with both drop-shadow and box-shadow CSS. The exception would be if there is a clear distinction between tokens to be used with box-shadow and drop-shadow. As drop-shadow can only accept a single shadow parameter. Any token that has two values will simply be incompatible with drop-shadow. Drop-shadow is likely the preferred choice among developers. |
Solid commentary! The ordering part is fixed in |
This should be handled in The update fixes the reverse ordering, and I've added your note on usage to the (updated) docs. Thanks! Feel free to get back in touch should something come up. |
Describe the bug
When retrieving token values for shadows from an object with two drop-shadow properties set, the order is reversed.
To Reproduce
Expected behavior
The order of values shall be the same as in Figma. In other words, the drop-shadow that is defined first shall have its values occur first. The drop-shadow that is defined second, shall have its values appear second.
Screenshots
The result from Figmagic (reversed order)
Note that the drop-shadow that appears first in Figma has the percentage value of 17%. That now appears last of the values.
Desktop
Additional context
The issue originates from that the Figma API returns them in reverse order. Can be seen by opening figma.json.
The text was updated successfully, but these errors were encountered: