Skip to content

pantoken-root / formats/scope/src / ensureProperties

함수: ensureProperties() ​

ensureProperties(css, options?): boolean

베타

css를 doc에 한 번 주입합니다. 동일한 id로 두 번째 호출을 해도 아무 영향이 없으며, 어느 인스턴스가 호출했든 마찬가지입니다.

매개변수 ​

css ​

string

npm 패키지 이름, 예: "@pantoken/components".

options? ​

id 관련 없는 시트를 구분합니다; doc 기본값은 현재 문서입니다.

id? ​

string

doc? ​

Document

반환값 ​

boolean

true 이 호출이 인젝션을 수행한 경우 true입니다.

예제 ​

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

ensureProperties(properties);