Skip to content

pantoken-root / formats/scope/src / createScope

Funzione: createScope() ​

createScope(element, options?): PantokenScope

Beta

Crea uno scope radicato in element.

Parametri ​

element ​

HTMLElement

options? ​

CreateScopeOptions = {}

Restituisce ​

PantokenScope

Esempio ​

Due temi indipendenti su una pagina

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,
});