DEV Community

Discussion on: TodoList part 4/n

Collapse
 
efpage profile image
Eckehard

As styles are most frequently used, you don´t need to set the style property explicitly. The two definitions are identical:
´´´js
button("all", {style: cssBtn}) // Properties as JSON-object
button("all", cssBtn) // style attributes as string only are converted
´´´
DML distinguishes the type of the second argument. Any string is automatically converted to a style property:
´´´js
"color: red;" ==> {style: "color: red;"}
´´´
This is just for convenience, but as in 95% of the cases only the style is set, this is a very handy abbreviation.

Collapse
 
artydev profile image
artydev • Edited

Thanks Eckehard☺
Very handy for sure, I have made the modification