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