---
url: /api/packages/utils/src.md
---
[pantoken-root](../../../index.md) / utils

# utils

Beta

`@pantoken/utils` — shared, upstream-free helpers used across the pantoken packages: the token
reference resolver (with `light-dark()` handling), the two token regexes (typed via `arkregex`),
kebab→camel case, hex-colour parsing, SVG sanitization, the pantoken spacing scale, reference-drift
validation, and the generic token→utility-class emitters that both `@pantoken/components`
(semantic tier) and `@pantoken/plugin-primitives` (raw-palette tier) build on. Depends only on
`@pantoken/model` (types) + `arkregex`, so any package can use it without pulling the GitHub-only
upstream.

The css-tree-backed token syntax validator lives at the separate `@pantoken/utils/token-syntax`
entry, not this barrel — `css-tree` bundles a runtime `createRequire()` JSON load that breaks when
pulled into a browser/SSR bundle, and this barrel is imported by browser-facing packages (e.g.
`@pantoken/components`) for the Node-free helpers above.

A pure barrel — every implementation lives in its own discrete module; add new helpers there and
re-export them here, don't grow this file.

## Interfaces

* [Rgba](interfaces/Rgba.md)
* [ResolveOptions](interfaces/ResolveOptions.md)
* [SpacingStep](interfaces/SpacingStep.md)
* [UtilityOptions](interfaces/UtilityOptions.md)
* [ColorUtilityNames](interfaces/ColorUtilityNames.md)
* [TokenUtilityGroup](interfaces/TokenUtilityGroup.md)

## Type Aliases

* [Mode](type-aliases/Mode.md)
* [Scheme](type-aliases/Scheme.md)
* [ColorUtilityEntry](type-aliases/ColorUtilityEntry.md)

## Variables

* [ELEVATION_NAMES](variables/ELEVATION_NAMES.md)
* [FOCUSABLE_SELECTOR](variables/FOCUSABLE_SELECTOR.md)
* [VAR_RE](variables/VAR_RE.md)
* [LIGHT_DARK_RE](variables/LIGHT_DARK_RE.md)
* [THEME_ATTR](variables/THEME_ATTR.md)
* [SCHEME_ATTR](variables/SCHEME_ATTR.md)
* [COLOR_ATTR](variables/COLOR_ATTR.md)
* [BOUNDARY_ATTR](variables/BOUNDARY_ATTR.md)
* [INSTANCE_ATTR](variables/INSTANCE_ATTR.md)
* [SCOPE_ATTRS](variables/SCOPE_ATTRS.md)
* [SCOPE_LAYERS](variables/SCOPE_LAYERS.md)
* [BOUNDARY_CLASS](variables/BOUNDARY_CLASS.md)
* [SPACING_STEPS](variables/SPACING_STEPS.md)
* [SPACING_AUTO_STEP](variables/SPACING_AUTO_STEP.md)

## Functions

* [camelCase](functions/camelCase.md)
* [parseHexColor](functions/parseHexColor.md)
* [elevationDeclarations](functions/elevationDeclarations.md)
* [focusOutlineDeclarations](functions/focusOutlineDeclarations.md)
* [focusOutlineRules](functions/focusOutlineRules.md)
* [extractInstuiRefs](functions/extractInstuiRefs.md)
* [tokenNames](functions/tokenNames.md)
* [unknownReferences](functions/unknownReferences.md)
* [danglingReferences](functions/danglingReferences.md)
* [makeResolver](functions/makeResolver.md)
* [resolveTokens](functions/resolveTokens.md)
* [isScheme](functions/isScheme.md)
* [themeClass](functions/themeClass.md)
* [schemeClass](functions/schemeClass.md)
* [colorClass](functions/colorClass.md)
* [themeScopeSelector](functions/themeScopeSelector.md)
* [schemeScopeSelector](functions/schemeScopeSelector.md)
* [colorScopeSelector](functions/colorScopeSelector.md)
* [themeScopeSelectors](functions/themeScopeSelectors.md)
* [schemeScopeSelectors](functions/schemeScopeSelectors.md)
* [colorScopeSelectors](functions/colorScopeSelectors.md)
* [sanitizeSvg](functions/sanitizeSvg.md)
* [globalModifierSelector](functions/globalModifierSelector.md)
* [colorUtilitiesCss](functions/colorUtilitiesCss.md)
* [tokenUtilitiesCss](functions/tokenUtilitiesCss.md)
