Mithril.js: Allow CSS vars to be specified via `style` attribute

Created on 19 Jul 2018  Â·  3Comments  Â·  Source: MithrilJS/mithril.js

Steps to Reproduce

In this example…

Expected Behavior

The first line of buttons should appear the same as the second.

Current Behavior

The first line of buttons do not have the CSS variable declarations applied, because CSS variables must be declared via setProperty

Possible Solution

Use the explicit style.getPropertyValue & style.setProperty APIs instead of treating style as a POJO to be assigned to

Enhancement

Most helpful comment

Wilco, I'll get on it in a tick. This will make interoperability with framework agnostic CSS-in-JS patterns far more powerful!

All 3 comments

Was worried about the potential perf considerations of this but it turns out React implemented this a year ago and it improved perf

@barneycarroll If that's the case, then let's do this.

Wilco, I'll get on it in a tick. This will make interoperability with framework agnostic CSS-in-JS patterns far more powerful!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikejav picture mikejav  Â·  3Comments

omenking picture omenking  Â·  3Comments

dhinesh03 picture dhinesh03  Â·  4Comments

hadihammurabi picture hadihammurabi  Â·  4Comments

pygy picture pygy  Â·  4Comments