Closed arnfaldur closed 3 years ago
I figured out a way to do this:
let element = document.createElement("button");
const style: CSS.Properties = {
color: "red",
margin: "1em",
};
Object.assign(element.style, style);
My issue is resolved and I created a pull request fixing it. I understand if this goes beyond the scope of this project so feel free to close both the issue and the pull request at your discretion.
I want to use this package in my JS project but I see no obvious way to use a
CSS.Properties
object. I will probably figure it out eventually but a minimal example of attaching style to an element (or another typical use-case) would be very helpful for beginners like me.