css - Reactjs turn off shorthand inline style helper -
currently, reactjs awesome job of assuming should pixel. in cases, don't need helper stuff. know great height , percentage:
{height: 100}
or {height: 100%}
in other cases need actual numbers, property:
webkitanimationiterationcount: 2
results -webkit-animation-iteration-count: 2px
how can escape pixel!
after digging react's source code, not yet possible (react 0.13.1):
there hardcoded list of unitless properties here: https://github.com/facebook/react/blob/v0.13.1/src/browser/ui/dom/cssproperty.js#l17 ,
animationiterationcount
not among themanything not in list have 'px' appended it: https://github.com/facebook/react/blob/v0.13.1/src/browser/ui/dom/dangerousstylevalue.js#l28
(maybe opportunity contribute react?)
Comments
Post a Comment