Skip to content

pantoken-root / formats/scope/src / ensureProperties

Hàm: ensureProperties() ​

ensureProperties(css, options?): boolean

Beta

Chèn css vào doc một lần. Lần gọi thứ hai với cùng id sẽ không làm gì, bất kể thể hiện nào gọi nó.

Tham số ​

css ​

string

Tên gói npm, ví dụ "@pantoken/components".

options? ​

id phân biệt các sheets không liên quan; doc mặc định là tài liệu hiện tại.

id? ​

string

doc? ​

Document

Trả về ​

boolean

true khi lời gọi này đã thực hiện việc chèn.

Ví dụ ​

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

ensureProperties(properties);