figma / code-snippet-editor-plugin

Translate component variants, properties, and more into dynamic code snippets for your design system.
https://www.figma.com/community/plugin/1311777988952403297/code-snippet-editor
MIT License
128 stars 11 forks source link

css parameters without "px" on the end, just the number value eg. 30 instead of 30px #12

Closed mikeysouthwell closed 8 months ago

mikeysouthwell commented 8 months ago

Is it possible to get the values for Border radius for example (which from what I can tell can only be extracted from the css property, but without the "px" in the value returned or somehow alter this value to show just 30 in Figma inspect?

If it has a border or 30px, just give us 30, or do we have to manually delete this from our own code base after pasting it in from your plugin?

jake-figma commented 8 months ago

This is the same answer for #15.

Right now, this plugin is only going to provide exactly what Figma provides via the plugin API. I don't want to introduce more code that performs transformations on plugin API CSS output, because the main objective of this codebase is education, and it's a lot clearer for folks to extend this themselves without a bunch of transformations on raw documented Figma output.

This is good feedback for the Plugin API team and I am going to share internally that its not fun to work with this sort of output. If you end up cloning this plugin you can write the adapter to do this!