Skip to content
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

Should gradient points be outside the bounding box? #377

Open
petemill opened this issue Sep 7, 2023 · 0 comments
Open

Should gradient points be outside the bounding box? #377

petemill opened this issue Sep 7, 2023 · 0 comments

Comments

@petemill
Copy link
Member

petemill commented Sep 7, 2023

Figma gives us coordinates for gradient points that are always between 0% and 100%. But the intention for many of our gradients looks like they are at ~-8%, etc. CSS makes this less bad by actually having the points originate outside the box due to the angle of the gradient. https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient#composition_of_a_linear_gradient
image

iOS might need to compute this in the same fashion.

But if that's not accurate enough for the designer intentions, then we might need access to figma's actual points. It gives this with SVG outputs and apparently maybe with more raw access to nodes / transforms.

This (maybe) talks about this:
https://forum.figma.com/t/how-to-convert-figma-gradient-to-css-gradient/20814
https://9elements.com/blog/gradient-angles-in-css-figma-and-sketch/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant