Skip to content

pantoken-root / formats/scope/src / ensureProperties

تابع: ensureProperties() ​

ensureProperties(css, options?): boolean

بتا

درج css در doc یک‌بار. تماس دوم با همان id هیچ کاری انجام نمی‌دهد، هر کدام از نمونه‌ها که آن را انجام دهد .

پارامترها ​

css ​

string

نام بسته npm، مثلاً "@pantoken/components".

options? ​

id sheets نام‌های غیر مرتبط را متمایز می‌کند؛ doc به‌طور پیش‌فرض به سند جاری تنظیم می‌شود.

id? ​

string

doc? ​

Document

مقدار بازگشتی ​

boolean

true هنگامی‌که این فراخوانی تزریق را انجام داده باشد.

نمونه ​

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

ensureProperties(properties);