in19farkt / css-to-jss

VS Code extension for converting CSS rules to JSS format
https://marketplace.visualstudio.com/items?itemName=infarkt.css-to-jss
15 stars 3 forks source link

px unit is stripped #4

Closed kasperific closed 4 years ago

kasperific commented 4 years ago

I noticed that rem and em don't get stripped, but px does. It would be helpful to keep the px unit. You can see in your demo, that the font-size rule is rendered as font-size: 11, which would be ignored by the browser.

in19farkt commented 4 years ago

CSS-in-JS libraries know that a px unit must be added to a stripped pixel. Therefore, I do not see any problems here. Material-UI example in Codesandbox.

I can add the needToStripPx setting if you have a case where the library did not add a px unit.

kasperific commented 4 years ago

I didn't realize CSS-in-JS libraries did that! Thanks!