font-size Property
Roxxik opened this issue · 3 comments
Roxxik commented
I am not able to use the style from React.DOM.Props to change the font-size of a text element, because it requires a label with the name font-size which in Purescript is not a valid identifier.
Unable to parse module:
unexpected -
expecting :, , or }
(totally unrelated, but in my opinion the expected tokens should be wrapped in quotes)
I got it working via my own prop handling, but i consider this only a workaround and not a real solution:
foreign import style_ :: forall val. String -> val -> Propsexports.style_ = function (key) {
return function(value) {
var result = {};
var attr = {};
attr[key] = value;
result["style"] = attr;
return result;
};
};Roxxik commented
Oh, my browser told me to use fontSize instead of font-size so i don't have this problem anymore
paf31 commented
For future reference, you can set object properties like this: { "font-size": "12px" }
Roxxik commented
Oh ok, this is good to know, but i haven't seen that documented anywhere