Skip to content

pantoken-root / formats/scope/src / ensureProperties

Function: ensureProperties() ​

ensureProperties(css, options?): boolean

Beta

Inject css into doc once. A second call with the same id does nothing, whichever instance makes it.

Parameters ​

css ​

string

The registrations sheet, e.g. @pantoken/css/properties.css.

options? ​

id distinguishes unrelated sheets; doc defaults to the current document.

id? ​

string

doc? ​

Document

Returns ​

boolean

true when this call performed the injection.

Example ​

ts
import { ensureProperties } from "@pantoken/scope";
import properties from "@pantoken/css/properties.css?inline";

ensureProperties(properties);