Skip to content

pantoken-root / formats/scope/src / createScope

Función: createScope() ​

createScope(element, options?): PantokenScope

Beta

Crear un ámbito enraizado en element.

Parámetros ​

element ​

HTMLElement

options? ​

CreateScopeOptions = {}

Devuelve ​

PantokenScope

Ejemplo ​

Dos temas independientes en una misma página**

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