yagudaev / css-gradient-to-figma

Plugin to insert a CSS Gradient into Figma
https://www.figma.com/community/plugin/1157089605295322526/CSS-Gradient-to-Figma
MIT License
18 stars 2 forks source link

feat: add support for %/px stop positions #11

Closed gluck closed 2 years ago

gluck commented 2 years ago
gluck commented 2 years ago
background: linear-gradient(45deg, rgb(236, 72, 153) 25%, rgb(239, 68, 68) 25%, rgb(239, 68, 68) 75%, rgb(234, 179, 8) 75%);
background: linear-gradient(45deg, rgb(236, 72, 153) 25px, rgb(239, 68, 68) 25px, rgb(239, 68, 68) 75px, rgb(234, 179, 8) 75px);

image

https://codepen.io/gluckies/pen/gOzyQJe

yagudaev commented 2 years ago

Yay! 🥳

Thanks for the PR, take a look at it now. Really appreciate it 😁

yagudaev commented 2 years ago

Excellent work! Added a few housekeeping things and tested it 😁.

You are right about negative values, and yet it will require scaling the gradient. Note that stops above 100% will also require scaling.