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 אמת כשקריאה זו ביצעה את ההזרקה.

דוגמה ​

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

ensureProperties(properties);