Spec-Zone.ru › Lit 1

Styles

function cssSource

Template tag which which can be used with LitElement's styles property to set element styles. For security reasons, only literal string values may be used. To incorporate non-literal values unsafeCSS may be used inside a template string part.

Import

import { css } from 'lit-element';

Signature

css(strings, values): CSSResult

Parameters

strings
TemplateStringsArray
values
Array<number | CSSResult>

class CSSResultSource

Import

import { CSSResult } from 'lit-element';

Methods and properties

new CSSResult(cssText, safeToken): CSSResultSource

Parameters
cssText
string
safeToken
symbol

readonly cssText: stringSource

styleSheet: null | CSSStyleSheetSource

toString(): stringSource

value supportsAdoptingStyleSheetsSource

Whether the current browser supports adoptedStyleSheets.

Import

import { supportsAdoptingStyleSheets } from 'lit-element';

Type

boolean

function unsafeCSSSource

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

Import

import { unsafeCSS } from 'lit-element';

Signature

unsafeCSS(value): CSSResult

Parameters

value
unknown

Details

This is unsafe because untrusted CSS text can be used to phone home or exfiltrate data to an attacker controlled site. Take care to only use this with trusted input.

type CSSResultArraySource

Import

import { CSSResultArray } from 'lit-element';

type CSSResultGroupSource

Import

import { CSSResultGroup } from 'lit-element';

Type

CSSResultOrNative | CSSResultArray

type CSSResultOrNativeSource

Import

import { CSSResultOrNative } from 'lit-element';

Type

CSSResult | CSSStyleSheet

© Google LLC
Licensed under the Creative Commons Attribution 3.0 Unported License.
https://lit.dev/docs/v1/api/lit-element/styles/

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API