Fix style updates to avoid unnecessary allocation (#2312)
* Fix style updates to avoid unnecessary allocation - Drive-by: properly censor `cssFloat` -> css `float:` to match DOM behavior * Document `style` syntax + custom property support. [skip ci] * Add a missing test * Add a few more descriptive comments. * Update changelog [skip ci]
This commit is contained in:
parent
b25e8e15a0
commit
8134c51a48
4 changed files with 41 additions and 25 deletions
|
|
@ -262,6 +262,8 @@ m("div[style=background:red]")
|
|||
|
||||
Using a string as a `style` would overwrite all inline styles in the element if it is redrawn, and not only CSS rules whose values have changed.
|
||||
|
||||
You can use both hyphenated CSS property names (like `background-color`) and camel cased DOM `style` property names (like `backgroundColor`). You can also define [CSS custom properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables), if your browser supports them.
|
||||
|
||||
Mithril does not attempt to add units to number values. It simply stringifies them.
|
||||
|
||||
---
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue