Skip to main content

getStyleObjectFromCSS

function

Parses inline CSS text into an object that is compatible with `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 getStyleObjectFromCSS(css: string): Record<string, string>

Import

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