Styles
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>
Import
import { CSSResult } from 'lit-element';
Methods and properties
Parameters
- cssText
string- safeToken
symbol
Whether the current browser supports adoptedStyleSheets.
Import
import { supportsAdoptingStyleSheets } from 'lit-element';
Type
booleanWrap 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.
Import
import { CSSResultArray } from 'lit-element';
Import
import { CSSResultGroup } from 'lit-element';
Type
CSSResultOrNative | CSSResultArrayImport
import { CSSResultOrNative } from 'lit-element';
Type
CSSResult | CSSStyleSheet