Skip to content

pantoken-root / formats/scope/src / createScope

Fonksiyon: createScope() ​

createScope(element, options?): PantokenScope

Beta

element'te köklenen bir kapsam oluşturun.

Parametreler ​

element ​

HTMLElement

options? ​

CreateScopeOptions = {}

Döndürür ​

PantokenScope

Örnek ​

Bir sayfada iki bağımsız tema

ts
import { createScope } from "@pantoken/scope";

createScope(document.querySelector("#app")!, { theme: "rebrand", scheme: "dark" });
createScope(document.querySelector("#preview")!, {
  instanceId: "preview",
  theme: "canvas",
  scheme: "light",
  boundary: true,
});