You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we automatically (and blindly) cast all numbers in the style object as pixels. The main reason for this is to avoid creating a map of values that should be in px vs not since this would increase the bundle size.
In any case I think it is acceptable that the opt out is simply to use strings in the styles eg <div style={ opacity: "1" }/>. However it might make sense to show warnings in development.
I would rather Marko not cast integers to pixels at all:
Pixels aren’t great practice in CSS: rems, ems, and percentages are preferred except for certain properties (like borders). I’m not banning pixels, but they shouldn’t be the convenient path — not more convenient than the flexible units, at least.
Not treating units specially would align Marko more with vanilla CSSOM code, which will only get more relevant with Houdini, custom properties, TypedOM, etc.
Marko Version: 4.15.2
You can also try it in the online playground
Repro
Output
The text was updated successfully, but these errors were encountered: