stoop
Version:
CSS-in-JS library with type inference, theme creation, and variants support.
26 lines (25 loc) • 1.1 kB
TypeScript
/**
* ThemeMap utilities for property-aware token resolution.
* Maps CSS properties to theme scales for deterministic token resolution.
*/
import type { ThemeScale } from "../types";
import { APPROVED_THEME_SCALES, DEFAULT_THEME_MAP } from "../constants";
export { APPROVED_THEME_SCALES, DEFAULT_THEME_MAP };
export type { ThemeScale };
/**
* Auto-detects theme scale from CSS property name using pattern matching.
* Used as fallback when property is not in DEFAULT_THEME_MAP.
*
* @param property - CSS property name
* @returns Theme scale name or undefined if no pattern matches
*/
export declare function autoDetectScale(property: string): ThemeScale | undefined;
/**
* Gets the theme scale for a CSS property.
* Checks user themeMap first, then default themeMap, then pattern matching.
*
* @param property - CSS property name
* @param userThemeMap - Optional user-provided themeMap override
* @returns Theme scale name or undefined if no mapping found
*/
export declare function getScaleForProperty(property: string, userThemeMap?: Record<string, ThemeScale>): ThemeScale | undefined;