To add inline styles on an element in JSX, you have to do it in this object syntax, like:
That might look a little weird to us folks who are so used to the CSS syntax, where it is
marginBottom), and semi-colons (not commas).
div.style.fontSize = "16px";
I say that, but other APIs do want you to use the CSS syntax, like:
Anyway, the actual reason for the post is this little website I came across that converts the CSS format to the object format. CSS2JS:
Definitely handy if you had a big block of styles to convert.
Direct Link to Article — Permalink
The post CSS2JS appeared first on CSS-Tricks.