FigmaToCode
FigmaToCode copied to clipboard
pxToTailwind never returns null
Hello.
I was diving into the code and noticed that pxToTailwind doesn't seem to ever return null but it is documented as possibly returning it.
When round is true, it will find the nearest key in the map and return its value (which is always a string it seems).
When round is false, it will return a string with the exact pixels specified.
If this is corrected, a good number of truthy checks in other conversion functions could likely be removed.
https://github.com/bernaferrari/FigmaToCode/blob/a783b5c8cab4e88a98e8988eb921dcab473e2153/packages/backend/src/tailwind/conversionTables.ts#L53
Thanks!!