Skip to content

pantoken-root / formats/scope/src / createScope

Функція: createScope() ​

createScope(element, options?): PantokenScope

Бета

Створити область, що має корінь у element.

Параметри ​

element ​

HTMLElement

options? ​

CreateScopeOptions = {}

Повертає ​

PantokenScope

Приклад ​

Дві незалежні теми на одній сторінці

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