Skip to content

pantoken-root / scope

scope ​

Beta

@pantoken/scope — run several pantoken themes and color schemes in one document.

Pantoken's CSS keys themes to a data-pantoken-theme attribute that matches any element, not just :root, so theming is a property of a subtree rather than of the page. This package is the runtime half of that contract:

  • resolveScope walks up from an element to find the theme, scheme, and color in effect — the auto-detection half.
  • createScope declares a scope explicitly, with its own persisted state and its own frame message channel — the manual-configuration half that stops two instances colliding.
  • ensureProperties injects the document-global @property registrations once, however many instances ask for them.

Node-free by design: this ships to the browser.

Interfaces ​

Type Aliases ​

Variables ​

Functions ​

References ​

BOUNDARY_ATTR ​

Re-exports BOUNDARY_ATTR


BOUNDARY_CLASS ​

Re-exports BOUNDARY_CLASS


COLOR_ATTR ​

Re-exports COLOR_ATTR


SCHEME_ATTR ​

Re-exports SCHEME_ATTR


THEME_ATTR ​

Re-exports THEME_ATTR


colorClass ​

Re-exports colorClass


schemeClass ​

Re-exports schemeClass


themeClass ​

Re-exports themeClass