APIActive

Lit Styles API

Lit's styling API: css, unsafeCSS, CSSResult, adoptStyles and related types.

Open source page ↗

Product features

Product features

addController ( controller ): void

adoptStyles

Applies the given styles to a shadowRoot.

attributeChangedCallback ( name , _old , value ): void

Attributes # Permalink to Attributes

Contents: LitElement

Controllers # Permalink to Controllers

css template tag

Template literal tag used with LitElement's styles property to set element styles.

CSSResult

Container for a string of CSS text that may be used to create a CSSStyleSheet.

Details

Dev mode # Permalink to Dev mode

getCompatibleStyle

Returns a compatible CSSResultOrNative for styling.

Import

LitElement

removeController ( controller ): void

static disableWarning ?: ( warningKind: WarningKind ) => void

static observedAttributes : Array< string >

supportsAdoptingStyleSheets

Boolean indicating whether the current browser supports adoptedStyleSheets.

unsafeCSS

Wraps a value for interpolation in a css tagged template literal.