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

Strip away `background-image:` and `background:` #17

Closed yagudaev closed 1 year ago

yagudaev commented 1 year ago

Copy gradients from webgradient.com results in input that looks like:

background-image: linear-gradient(to right, #43e97b 0%, #38f9d7 100%);

Pasting that in the plugin will show an error. Instead, we can simply ignore that part and let the user paste the gradient uninterrupted.

Myrfion commented 1 year ago

Hello, could you assign this one on me? Thanks

yagudaev commented 1 year ago

@Myrfion I would love that 😁. Also be aware of https://github.com/yagudaev/css-gradient-to-figma/pull/16. I'm hoping to have it reviewed and merged today

yagudaev commented 1 year ago

The code you are looking for is: https://github.com/yagudaev/css-gradient-to-figma/blob/main/src/shared/color.ts#L21, there is also a test file now.

You should be all clear to go now that #18 has been merged 😁. @Myrfion

Myrfion commented 1 year ago

Hi, just wanted to approach it, so is it still an issue or it was resolved in #18 I am kinda confused 😅

yagudaev commented 1 year ago

@Myrfion #18 is resolved now, you have a green light 🟢. Go a head create a PR to solve this issue here.

Excited to see it 😁

Myrfion commented 1 year ago

I tried to put the value like background-image: linear-gradient(to right, #43e97b 0%, #38f9d7 100%); and I don't see an error, seems to work fine 🤔

yagudaev commented 1 year ago

Oh very cool, looks like the value parser we used in #18 which is the same one used by PostCSS actually accounts for the property name too.

I'll close this one. Great find and @gluck thanks again for the sick PR.

@Myrfion there are two more good first issues if you want to try them here: https://github.com/yagudaev/css-gradient-to-figma/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22