Skip to main content

setDOMStyleFromCSS

function

Applies inline CSS text to a DOM style declaration using `CSSStyleDeclaration.setProperty()`. Property names are expected to be kebab-case, such as `font-size`, and values are expected to include explicit units where needed, such as `12px`.

function setDOMStyleFromCSS(domStyle: CSSStyleDeclaration, cssText: string, prevCSSText?: string): void

Import

import { setDOMStyleFromCSS } from '@modular/sdk/editor';