Letter spacing units should be returned through REST API

There is inconsistency between what is shown in Figma UI and what is sent in response for Figma file (GET /v1/files/:key - https://www.figma.com/developers/api#get-files-endpoint) related to letter spacing for Typography token.

It’s possible to declare letter spacing using either pixels or percents, but in API response we always receive values in pixels. It would be really nice to know original letter spacing unit.

Here are 2 different typography with 12px and 12% letter spacing and their representation in API (GET /v1/files/:key):

As you can see, we can’t build our interface for this letter spacing unit that would match values configured in Figma UI. So, it leads to inconsistency for our users that see percent values in Figma but pixel values in our UI. Or vice versa: if we convert all pixel letter spacing to percents, then people created letter spacing in pixels would see another value in percent units.

2 Likes

Hey Yevhenii_Kuznetsov, thank you for sharing you feedback. We’ll pass along to our team for consideration!