@barocss/kit 0.8.2 → 0.9.0

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.
package/dist/index.d.cts CHANGED
@@ -289,7 +289,15 @@ export declare type AstNode = {
289
289
 
290
290
  export declare type FunctionalUtilityExtra = {
291
291
  opacity?: string;
292
+ /** The theme key that matched, set when it is a colour key (or the utility lists no `colors` namespace). */
292
293
  realThemeValue?: string;
294
+ /**
295
+ * #338: the theme namespace that resolved the key and the key itself. On a root shared by colours and another
296
+ * namespace (`border-*`: colors + borderWidth), a key from the other namespace leaves `realThemeValue` unset so the
297
+ * colour branch does not claim it; the handler dispatches on `themeNamespace` instead.
298
+ */
299
+ themeNamespace?: string;
300
+ themeKey?: string;
293
301
  };
294
302
 
295
303
  export declare type FunctionalUtilityOptions = {
@@ -1136,6 +1144,12 @@ export declare type AstNode = {
1136
1144
  */
1137
1145
  export declare function themeGetter(themeObj: Theme, ...path: (string | number)[]): unknown;
1138
1146
 
1147
+ /** #300: the literal value of `theme.<namespace>.<key>` when it is a string, else null. */
1148
+ export declare function themeKeyValue(ctx: Context, namespace: string, key: string): string | null;
1149
+
1150
+ /** #300: `var(--<varPrefix>-<key>)` when `theme.<namespace>.<key>` exists (the :root var BaroCSS emits for it), else null. */
1151
+ export declare function themeKeyVar(ctx: Context, namespace: string, key: string, varPrefix: string): string | null;
1152
+
1139
1153
  export declare function themeToCssVars(theme: Theme): string;
1140
1154
 
1141
1155
  export declare interface Token {
package/dist/index.d.ts CHANGED
@@ -289,7 +289,15 @@ export declare type AstNode = {
289
289
 
290
290
  export declare type FunctionalUtilityExtra = {
291
291
  opacity?: string;
292
+ /** The theme key that matched, set when it is a colour key (or the utility lists no `colors` namespace). */
292
293
  realThemeValue?: string;
294
+ /**
295
+ * #338: the theme namespace that resolved the key and the key itself. On a root shared by colours and another
296
+ * namespace (`border-*`: colors + borderWidth), a key from the other namespace leaves `realThemeValue` unset so the
297
+ * colour branch does not claim it; the handler dispatches on `themeNamespace` instead.
298
+ */
299
+ themeNamespace?: string;
300
+ themeKey?: string;
293
301
  };
294
302
 
295
303
  export declare type FunctionalUtilityOptions = {
@@ -1136,6 +1144,12 @@ export declare type AstNode = {
1136
1144
  */
1137
1145
  export declare function themeGetter(themeObj: Theme, ...path: (string | number)[]): unknown;
1138
1146
 
1147
+ /** #300: the literal value of `theme.<namespace>.<key>` when it is a string, else null. */
1148
+ export declare function themeKeyValue(ctx: Context, namespace: string, key: string): string | null;
1149
+
1150
+ /** #300: `var(--<varPrefix>-<key>)` when `theme.<namespace>.<key>` exists (the :root var BaroCSS emits for it), else null. */
1151
+ export declare function themeKeyVar(ctx: Context, namespace: string, key: string, varPrefix: string): string | null;
1152
+
1139
1153
  export declare function themeToCssVars(theme: Theme): string;
1140
1154
 
1141
1155
  export declare interface Token {