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
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
booleanfunction 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 | CSSResultArraytype 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/