Skip to main content
Question

Plugin API to convert gradient paint styles to CSS

  • February 9, 2023
  • 1 reply
  • 1695 views

Jon_Sakas1

Hello, I made a plugin called Color Import / Export.

Currently, it only handles Solid paint styles but I have received requests to add support for Gradient paint styles.

By looking at the GradientPaintStyle interface, there will be a lot of work and complexity in re-engineering how you convert these to CSS for the “Inspect” feature of Figma. A lot of that comes from converting the transform matrix into color stops and angles.

I am wondering if this API could be exposed to the plugin developers so we do not have to re-invent what is already done by Figma, but could use that functionality in new ways (such as for my plugin 🙂).

Thank you.

This topic has been closed for comments

1 reply

Jens_Lembke
  • New Member
  • 1 reply
  • June 5, 2024

I’m facing the same issue. I want to convert GradientPaintStyle values into variables so that they can be used in CSS. The Figma documentation doesn’t provide much information on how to handle color stops, angles, etc. It would be great if we could get more information from Figma on this. Has anyone already solved this problem?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings