Skip to content

pantoken-root / formats/scope/src / resolveScope

Swyddogaeth: resolveScope() ​

resolveScope(start): ResolvedScope

Bêta

Resolve the scope in effect for start drwy gerdded i fyny ei hynafiaid.

Paramedrau ​

start ​

Element | null

Yr elfen i'w datrys ar ei chyfer. Mae ei nodweddion ei hun yn cyfrannu.

Yn dychwelyd ​

ResolvedScope

The ResolvedScope; caeau na ddatganwyd gan unrhyw hynafiaid yn aros yn undefined.

Enghraifft ​

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

// <div data-pantoken-theme="canvas"><span id="x"></span></div>
resolveScope(document.querySelector("#x")!).theme; // "canvas"