Open nathanacurtis opened 1 year ago
I came here to make this same request.
Measure plugin:
You can write a "complex" pattern like this ($###2.5) or a simple one ($). $ represents the value, after that you can add a multiplier or divider ( or /) the repetition of the # symbol indicates the number of digits after the decimal point. You can also fill the field with only one unit of measurement and everything will be automatically calculated based on 72dpi. (cm,mm,px,pt,dp,",in) Example: Imagine your base unit is 8px=1x. So when a square is 64px the measurement will be 8x as the result. ($###/8)x
Measure is open source, with their pattern matching: https://github.com/ph1p/figma-measure/blob/main/src/shared/helpers.ts#L18
Is your feature request related to a problem? Please describe.
Our design system uses a transformation for spacing units, and I have to manually update the automated specs to display that transformation.
Describe the solution you'd like
From the requester: For spacing, it would be really great if I could configure custom units. In our design system 4px = 1 "spacing unit". I can manually change these in the generated spec but it would great if I could have the plugin do it. The "Measure" plugin has a similar feature
From @nathanacurtis