Skip to content

pantoken-root / formats/scope/src / ensureProperties

Functie: ensureProperties() ​

ensureProperties(css, options?): boolean

Bèta

Injecteer css één keer in doc. Een tweede aanroep met hetzelfde id doet niets, ongeacht welke instantie het maakt.

Parameters ​

css ​

string

De npm-pakketnaam, bijv. "@pantoken/components".

options? ​

id onderscheidt niet-verwante sheets; doc heeft als standaard het huidige document.

id? ​

string

doc? ​

Document

Retourneert ​

boolean

true wanneer deze oproep de injectie heeft uitgevoerd.

Voorbeeld ​

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

ensureProperties(properties);