---
url: /api/formats/scope/src/functions/resolveScope.md
---
[pantoken-root](../../../../index.md) / [formats/scope/src](../index.md) / resolveScope

# Function: resolveScope()

> **resolveScope**(`start`): [`ResolvedScope`](../interfaces/ResolvedScope.md)

Beta

Resolve the scope in effect for `start` by walking up its ancestors.

## Parameters

### start

`Element` | `null`

The element to resolve for. Its own attributes participate.

## Returns

[`ResolvedScope`](../interfaces/ResolvedScope.md)

The [ResolvedScope](../interfaces/ResolvedScope.md); fields no ancestor declared are left `undefined`.

## Example

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

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