@stacksjs/ts-css 0.3.11 → 0.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,11 @@ import type { CssConfig, ParsedClass, UtilityRuleResult } from './types';
4
4
  // arbitrary values. Unknown words return undefined — they previously
5
5
  // leaked verbatim (`w-sidebar` emitted `width: sidebar;`).
6
6
  export declare function resolveSizeToken(parsed: { value?: string, arbitrary: boolean }, config: { theme: { spacing: Record<string, string> } }, sizeMap: Record<string, string>): string | undefined;
7
+ /**
8
+ * A theme colour as a utility writes it: the value itself, or, for a palette
9
+ * in `colorVariables`, a variable named after the colour that falls back to it.
10
+ */
11
+ export declare function themeColorValue(key: string, value: string, palette: string, variables: readonly string[] | undefined): string;
7
12
  // Helper to apply opacity to color
8
13
  export declare function applyOpacity(color: string, opacity: number): string;
9
14
  /**
@@ -11,7 +16,7 @@ export declare function applyOpacity(color: string, opacity: number): string;
11
16
  * Handles: special keywords, direct colors, color-shade, opacity modifiers (/50, /[0.04]).
12
17
  * Returns the resolved CSS color string or undefined if not found.
13
18
  */
14
- export declare function resolveColorValue(value: string, config: { theme: { colors: Record<string, any> } }, modifierArbitrary?: boolean): string | undefined;
19
+ export declare function resolveColorValue(value: string, config: { theme: { colors: Record<string, any> }, colorVariables?: string[] }, modifierArbitrary?: boolean): string | undefined;
15
20
  /**
16
21
  * Built-in utility rules
17
22
  * Each rule checks if it matches the parsed class and returns CSS properties
@@ -47,6 +47,7 @@ export declare interface CssConfig {
47
47
  bracketSyntax?: BracketSyntaxConfig
48
48
  codeStrings?: CodeStringsConfig
49
49
  cssVariables?: boolean
50
+ colorVariables?: string[]
50
51
  styles?: string[]
51
52
  }
52
53
  export declare interface Theme {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/ts-css",
3
3
  "type": "module",
4
- "version": "0.3.11",
4
+ "version": "0.3.13",
5
5
  "description": "Pure-TypeScript CSS toolkit and utility-first CSS engine for Bun/Node — parser, walker, generator, selector engine, minifier, and a Tailwind-compatible utility engine. Zero runtime deps.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",