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
Signature
css(strings, values): CSSResult
Parameters
- strings
TemplateStringsArray
- values
Array<number | CSSResult>
Import
Methods and properties
Parameters
- cssText
string
- safeToken
symbol
Whether the current browser supports adoptedStyleSheets
.
Import
Type
boolean
Wrap a value for interpolation in a css
tagged template literal.
Import
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
Type
CSSResultOrNative | CSSResultArray
Import
Type
CSSResult | CSSStyleSheet