davesnx / styled-ppx

Type-safe styled components for ReScript, Melange and native with type-safe CSS
https://styled-ppx.vercel.app
BSD 2-Clause "Simplified" License
401 stars 32 forks source link

[bug] Double-quotes on CssJs.unsafe for font-family that include quotes? #342

Closed AlexMoutonNoble closed 1 year ago

AlexMoutonNoble commented 1 year ago

Hi David! Our team has been using quotes for font family strings that have whitespace:

font-family: "Inter Semi Bold";

This seems like it should be valid, maybe single quotes?, but produces:

CssJs.unsafe("fontFamily", ""Inter Semi Bold""),

I have removed the quotes for now but maybe something to be handled here?

Thanks Alex

[edit: this on 0.36.2]

davesnx commented 1 year ago

Hey @AlexMoutonNoble, that's a bug for sure. It should generate CssJs.unsafe("fontFamily", {js|"Inter Semi Bold"|js}).

davesnx commented 1 year ago

Hey @AlexMoutonNoble, what's the annotation you use for font family in this case? (cx, styled, global? and probably you are using ReScript, right?

davesnx commented 1 year ago

Fixed in 7f0594d2b8dcc2c86753fa699bd32a652bcdfe22