shakurocom / figma-extractor

https://figma-extractor.vercel.app
MIT License
22 stars 5 forks source link

[BUG] The generation of empty styles for missing screens #23

Closed chdg61 closed 1 year ago

chdg61 commented 1 year ago

So, I have noticed that if there are multiple styles with one screen resize (for example the project has only a style like h700-lg) then figma-extractor will generate styles with undefined values. It happens because the Figma doesn't have a base style for h700.

Let's look at an example with h700-lg without h700-bs or h700.
If we launch figma-extractor we will get the code inside text-styles.js as below:

 '.h700': {
    fontFamily: undefined,
    fontSize: undefined,
    fontWeight: undefined,
    textTransform: 'undefined',
    lineHeight: undefined,

    '@media (min-width: 1280px)': {
      fontFamily: fontFamily.font3,
      fontSize: 40,
      fontWeight: 400,
      textTransform: 'uppercase',
      lineHeight: 1.24,
      letterSpacing: '3.2px',
    },
  },

I've added extra conditionals to avoid such a behavior

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
figma-extractor ❌ Failed (Inspect) Feb 17, 2023 at 9:15AM (UTC)