addStyle
Style properties to apply.
StoreMap type when used reactively.
Element type (defaults to HTMLElement).
Style properties or store and mapper function
Utility function for adding styles
Applies CSS styles to an element. Supports reactive styles when using stores.
const setColor = addStyle<HTMLDivElement, { color: string }>( { color: "red" })(MyElement); Copy
const setColor = addStyle<HTMLDivElement, { color: string }>( { color: "red" })(MyElement);
addStyle