mikaelvesavuori / figmagic

Figmagic is the missing piece between DevOps and design: Generate design tokens, export graphics, and extract design token-driven React components from your Figma documents.
https://docs.figmagic.com
MIT License
807 stars 71 forks source link

Add possibility to configure the Line Height Unit #109

Closed opauloh closed 3 years ago

opauloh commented 3 years ago

Hey all,

On my team, we have been using Figmagic, and it's awesome,

One thing we found to be useful is to have the possibility to customize the Line Height unit, to measures like px, rem, and em.

One of the use cases we have is that our design system provides design tokens for both React and React Native, in the case of React Native we can't use the unitless measure this way, because it interprets unitless as px.

For example, a line-height unit like 1.5, would be interpreted as 1.5px by React Native, as can be seen here

So we found it to be better to generate tokens as px, and at the time of generating the React native tokens we just remove the px, making them all be a "unitless px" format

mikaelvesavuori commented 3 years ago

Very good contribution by the way!

sonarcloud[bot] commented 3 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

opauloh commented 3 years ago

Looks good! Verified and seems to work as expected.

Could you however just remove the console.log() statement, and I'd be happy to merge this :)

Thank you @mikaelvesavuori, just removed the console

Very good contribution by the way!

Hey, thanks! I'm very happy with my first contribution to Figmagic, glad to see that you liked!

mikaelvesavuori commented 3 years ago

Merged. Note: There's still some wonkiness with what the CI can do in automated testing, so it "fails" but it actually looks good.

mikaelvesavuori commented 3 years ago

Your work, plus a couple of minor additional fixes, will shortly be available in version 4.2.20.

Again, thanks for contributing! Your name is added to the list of contributors. If you object, please just say so, otherwise I'm happy to give credit to all of you who take time to make Figmagic better.

opauloh commented 3 years ago

That's awesome! looking forward to version 4.2.20, thanks very much for adding me to the contributor's list ❤️