@tokenami/config 0.0.35 → 0.0.37

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.mts CHANGED
@@ -1,19 +1,28 @@
1
- declare const layers: readonly [["all", "-webkit-line-clamp", "accent-color", "align-tracks", "animation", "appearance", "aspect-ratio", "backdrop-filter", "backface-visibility", "background", "border", "border-collapse", "border-spacing", "border-radius", "box-decoration-break", "box-shadow", "box-sizing", "break-after", "break-before", "break-inside", "caption-side", "clear", "clip-path", "color", "color-scheme", "column-fill", "column-span", "column-rule", "columns", "contain", "contain-intrinsic-size", "container", "content", "content-visibility", "counter-increment", "counter-reset", "counter-set", "cursor", "direction", "display", "empty-cells", "filter", "flex", "flex-flow", "float", "font", "font-feature-settings", "font-kerning", "font-language-override", "font-optical-sizing", "font-palette", "font-size-adjust", "font-synthesis", "font-variation-settings", "forced-color-adjust", "gap", "grid", "grid-area", "grid-column", "grid-row", "grid-template", "hanging-punctuation", "height", "hyphenate-character", "hyphenate-limit-chars", "hyphens", "image-orientation", "image-rendering", "image-resolution", "initial-letter", "input-security", "inset", "isolation", "justify-tracks", "letter-spacing", "line-break", "line-clamp", "line-height-step", "list-style", "margin", "mask", "mask-border", "math-depth", "math-shift", "math-style", "max-height", "max-width", "min-height", "min-width", "mix-blend-mode", "object-fit", "object-position", "offset", "opacity", "order", "orphans", "outline", "overflow", "overscroll-behavior", "padding", "page", "paint-order", "perspective", "perspective-origin", "place-content", "place-items", "place-self", "pointer-events", "position", "print-color-adjust", "quotes", "resize", "rotate", "ruby-position", "scale", "scroll-behavior", "scroll-margin", "scroll-padding", "scroll-snap-align", "scroll-snap-stop", "scroll-snap-type", "scroll-timeline", "scrollbar-color", "scrollbar-gutter", "scrollbar-width", "shape-image-threshold", "shape-margin", "shape-outside", "tab-size", "table-layout", "text-align", "text-align-last", "text-combine-upright", "text-decoration", "text-decoration-skip-ink", "text-emphasis", "text-emphasis-position", "text-indent", "text-justify", "text-orientation", "text-overflow", "text-rendering", "text-shadow", "text-size-adjust", "text-transform", "text-underline-offset", "text-underline-position", "touch-action", "transform", "transform-box", "transform-origin", "transform-style", "transition", "translate", "unicode-bidi", "user-select", "vertical-align", "view-transition-name", "visibility", "white-space", "widows", "width", "will-change", "word-break", "word-spacing", "word-wrap", "writing-mode", "z-index", "zoom"], ["animation-composition", "animation-delay", "animation-direction", "animation-duration", "animation-fill-mode", "animation-iteration-count", "animation-name", "animation-play-state", "animation-timeline", "animation-timing-function", "background-attachment", "background-blend-mode", "background-clip", "background-color", "background-image", "background-origin", "background-position", "background-position-x", "background-position-y", "background-repeat", "background-size", "border-top", "border-right", "border-bottom", "border-left", "border-top-left-radius", "border-top-right-radius", "border-bottom-left-radius", "border-bottom-right-radius", "caret-color", "caret-shape", "column-rule-color", "column-rule-style", "column-rule-width", "column-count", "column-width", "contain-intrinsic-width", "contain-intrinsic-height", "container-name", "container-type", "flex-grow", "flex-shrink", "flex-basis", "flex-direction", "flex-wrap", "font-style", "font-variant", "font-weight", "font-stretch", "font-size", "font-family", "row-gap", "column-gap", "grid-auto-columns", "grid-auto-flow", "grid-auto-rows", "grid-template-areas", "grid-template-columns", "grid-template-rows", "grid-row-start", "grid-column-start", "grid-row-end", "grid-column-end", "top", "right", "bottom", "left", "line-height", "list-style-image", "list-style-position", "list-style-type", "margin-top", "margin-right", "margin-bottom", "margin-left", "mask-border-mode", "mask-border-outset", "mask-border-repeat", "mask-border-slice", "mask-border-source", "mask-border-width", "mask-clip", "mask-composite", "mask-image", "mask-mode", "mask-origin", "mask-position", "mask-repeat", "mask-size", "mask-type", "offset-anchor", "offset-distance", "offset-path", "offset-position", "offset-rotate", "outline-color", "outline-offset", "outline-style", "outline-width", "overflow-anchor", "overflow-clip-margin", "overflow-wrap", "overflow-x", "overflow-y", "overscroll-behavior-x", "overscroll-behavior-y", "padding-top", "padding-right", "padding-bottom", "padding-left", "align-content", "justify-content", "align-items", "justify-items", "align-self", "justify-self", "scroll-margin-top", "scroll-margin-right", "scroll-margin-bottom", "scroll-margin-left", "scroll-padding-top", "scroll-padding-right", "scroll-padding-bottom", "scroll-padding-left", "scroll-timeline-axis", "scroll-timeline-name", "text-decoration-color", "text-decoration-line", "text-decoration-style", "text-decoration-thickness", "text-emphasis-color", "text-emphasis-style", "transition-delay", "transition-duration", "transition-property", "transition-timing-function"], ["border-style", "border-color", "border-width", "border-image", "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", "font-variant-emoji", "font-variant-ligatures", "font-variant-numeric", "font-variant-position"], ["border-top-color", "border-top-style", "border-top-width", "border-right-color", "border-right-style", "border-right-width", "border-bottom-color", "border-bottom-style", "border-bottom-width", "border-left-color", "border-left-style", "border-left-width", "border-image-outset", "border-image-repeat", "border-image-slice", "border-image-source", "border-image-width"], ["block-size", "border-block", "border-inline", "contain-intrinsic-block-size", "contain-intrinsic-inline-size", "inline-size", "inset-block", "inset-inline", "margin-block", "margin-inline", "max-block-size", "min-block-size", "max-inline-size", "min-inline-size", "overflow-block", "overflow-inline", "overscroll-behavior-block", "overscroll-behavior-inline", "padding-block", "padding-inline", "scroll-margin-block", "scroll-margin-inline", "scroll-padding-block", "scroll-padding-inline"], ["border-block-width", "border-block-style", "border-block-color", "border-block-start", "border-block-end", "border-inline-color", "border-inline-style", "border-inline-width", "border-inline-start", "border-inline-end", "inset-block-end", "inset-block-start", "inset-inline-end", "inset-inline-start", "margin-block-end", "margin-block-start", "margin-inline-end", "margin-inline-start", "padding-block-end", "padding-block-start", "padding-inline-end", "padding-inline-start", "scroll-margin-block-end", "scroll-margin-block-start", "scroll-margin-inline-end", "scroll-margin-inline-start", "scroll-padding-block-end", "scroll-padding-block-start", "scroll-padding-inline-end", "scroll-padding-inline-start"], ["border-start-end-radius", "border-start-start-radius", "border-end-end-radius", "border-end-start-radius", "border-block-start-color", "border-block-start-style", "border-block-start-width", "border-block-end-color", "border-block-end-style", "border-block-end-width", "border-inline-start-color", "border-inline-start-style", "border-inline-start-width", "border-inline-end-color", "border-inline-end-style", "border-inline-end-width"]];
1
+ declare const layers: readonly [["all", "-webkit-line-clamp", "accent-color", "align-tracks", "animation", "appearance", "aspect-ratio", "backdrop-filter", "backface-visibility", "background", "border", "border-collapse", "border-spacing", "border-radius", "box-decoration-break", "box-shadow", "box-sizing", "break-after", "break-before", "break-inside", "caption-side", "clear", "clip-path", "color", "color-scheme", "column-fill", "column-span", "column-rule", "columns", "contain", "contain-intrinsic-size", "container", "content", "content-visibility", "counter-increment", "counter-reset", "counter-set", "cursor", "direction", "display", "empty-cells", "fill", "filter", "flex", "flex-flow", "float", "font", "font-feature-settings", "font-kerning", "font-language-override", "font-optical-sizing", "font-palette", "font-size-adjust", "font-synthesis", "font-variation-settings", "forced-color-adjust", "gap", "grid", "grid-area", "grid-column", "grid-row", "grid-template", "hanging-punctuation", "height", "hyphenate-character", "hyphenate-limit-chars", "hyphens", "image-orientation", "image-rendering", "image-resolution", "initial-letter", "input-security", "inset", "isolation", "justify-tracks", "letter-spacing", "line-break", "line-clamp", "line-height-step", "list-style", "margin", "mask", "mask-border", "math-depth", "math-shift", "math-style", "max-height", "max-width", "min-height", "min-width", "mix-blend-mode", "object-fit", "object-position", "offset", "opacity", "order", "orphans", "outline", "overflow", "overscroll-behavior", "padding", "page", "paint-order", "perspective", "perspective-origin", "place-content", "place-items", "place-self", "pointer-events", "position", "print-color-adjust", "quotes", "resize", "rotate", "ruby-position", "scale", "scroll-behavior", "scroll-margin", "scroll-padding", "scroll-snap-align", "scroll-snap-stop", "scroll-snap-type", "scroll-timeline", "scrollbar-color", "scrollbar-gutter", "scrollbar-width", "shape-image-threshold", "shape-margin", "shape-outside", "stroke", "tab-size", "table-layout", "text-align", "text-align-last", "text-combine-upright", "text-decoration", "text-decoration-skip-ink", "text-emphasis", "text-emphasis-position", "text-indent", "text-justify", "text-orientation", "text-overflow", "text-rendering", "text-shadow", "text-size-adjust", "text-transform", "text-underline-offset", "text-underline-position", "touch-action", "transform", "transform-box", "transform-origin", "transform-style", "transition", "translate", "unicode-bidi", "user-select", "vertical-align", "view-transition-name", "visibility", "white-space", "widows", "width", "will-change", "word-break", "word-spacing", "word-wrap", "writing-mode", "z-index", "zoom"], ["animation-composition", "animation-delay", "animation-direction", "animation-duration", "animation-fill-mode", "animation-iteration-count", "animation-name", "animation-play-state", "animation-timeline", "animation-timing-function", "background-attachment", "background-blend-mode", "background-clip", "background-color", "background-image", "background-origin", "background-position", "background-position-x", "background-position-y", "background-repeat", "background-size", "border-top", "border-right", "border-bottom", "border-left", "border-top-left-radius", "border-top-right-radius", "border-bottom-left-radius", "border-bottom-right-radius", "caret-color", "caret-shape", "column-rule-color", "column-rule-style", "column-rule-width", "column-count", "column-width", "contain-intrinsic-width", "contain-intrinsic-height", "container-name", "container-type", "flex-grow", "flex-shrink", "flex-basis", "flex-direction", "flex-wrap", "font-style", "font-variant", "font-weight", "font-stretch", "font-size", "font-family", "row-gap", "column-gap", "grid-auto-columns", "grid-auto-flow", "grid-auto-rows", "grid-template-areas", "grid-template-columns", "grid-template-rows", "grid-row-start", "grid-column-start", "grid-row-end", "grid-column-end", "top", "right", "bottom", "left", "line-height", "list-style-image", "list-style-position", "list-style-type", "margin-top", "margin-right", "margin-bottom", "margin-left", "mask-border-mode", "mask-border-outset", "mask-border-repeat", "mask-border-slice", "mask-border-source", "mask-border-width", "mask-clip", "mask-composite", "mask-image", "mask-mode", "mask-origin", "mask-position", "mask-repeat", "mask-size", "mask-type", "offset-anchor", "offset-distance", "offset-path", "offset-position", "offset-rotate", "outline-color", "outline-offset", "outline-style", "outline-width", "overflow-anchor", "overflow-clip-margin", "overflow-wrap", "overflow-x", "overflow-y", "overscroll-behavior-x", "overscroll-behavior-y", "padding-top", "padding-right", "padding-bottom", "padding-left", "align-content", "justify-content", "align-items", "justify-items", "align-self", "justify-self", "scroll-margin-top", "scroll-margin-right", "scroll-margin-bottom", "scroll-margin-left", "scroll-padding-top", "scroll-padding-right", "scroll-padding-bottom", "scroll-padding-left", "scroll-timeline-axis", "scroll-timeline-name", "text-decoration-color", "text-decoration-line", "text-decoration-style", "text-decoration-thickness", "text-emphasis-color", "text-emphasis-style", "transition-delay", "transition-duration", "transition-property", "transition-timing-function"], ["border-style", "border-color", "border-width", "border-image", "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", "font-variant-emoji", "font-variant-ligatures", "font-variant-numeric", "font-variant-position"], ["border-top-color", "border-top-style", "border-top-width", "border-right-color", "border-right-style", "border-right-width", "border-bottom-color", "border-bottom-style", "border-bottom-width", "border-left-color", "border-left-style", "border-left-width", "border-image-outset", "border-image-repeat", "border-image-slice", "border-image-source", "border-image-width"], ["block-size", "border-block", "border-inline", "contain-intrinsic-block-size", "contain-intrinsic-inline-size", "inline-size", "inset-block", "inset-inline", "margin-block", "margin-inline", "max-block-size", "min-block-size", "max-inline-size", "min-inline-size", "overflow-block", "overflow-inline", "overscroll-behavior-block", "overscroll-behavior-inline", "padding-block", "padding-inline", "scroll-margin-block", "scroll-margin-inline", "scroll-padding-block", "scroll-padding-inline"], ["border-block-width", "border-block-style", "border-block-color", "border-block-start", "border-block-end", "border-inline-color", "border-inline-style", "border-inline-width", "border-inline-start", "border-inline-end", "inset-block-end", "inset-block-start", "inset-inline-end", "inset-inline-start", "margin-block-end", "margin-block-start", "margin-inline-end", "margin-inline-start", "padding-block-end", "padding-block-start", "padding-inline-end", "padding-inline-start", "scroll-margin-block-end", "scroll-margin-block-start", "scroll-margin-inline-end", "scroll-margin-inline-start", "scroll-padding-block-end", "scroll-padding-block-start", "scroll-padding-inline-end", "scroll-padding-inline-start"], ["border-start-end-radius", "border-start-start-radius", "border-end-end-radius", "border-end-start-radius", "border-block-start-color", "border-block-start-style", "border-block-start-width", "border-block-end-color", "border-block-end-style", "border-block-end-width", "border-inline-start-color", "border-inline-start-style", "border-inline-start-width", "border-inline-end-color", "border-inline-end-style", "border-inline-end-width"]];
2
2
  type Flatten<T> = {
3
3
  [K in keyof T]: T[K] extends Array<infer E> ? E : T[K];
4
4
  };
5
5
  type CSSProperty = Flatten<typeof layers>[number];
6
6
  declare const properties: CSSProperty;
7
7
 
8
- type DeepReadonly<T> = T extends any[] ? T : {
8
+ type DeepReadonly<T> = T extends Function | any[] ? T : {
9
9
  readonly [P in keyof T]: DeepReadonly<T[P]>;
10
10
  };
11
11
  type ThemeKey = 'alpha' | 'border' | 'color' | 'ease' | 'font-size' | 'leading' | 'line-style' | 'radii' | 'size' | 'shadow' | 'tracking' | 'transition' | 'weight' | 'z' | (string & {});
12
12
  type ThemeValues = Record<string, string>;
13
- type Theme = Partial<Record<ThemeKey, ThemeValues>>;
13
+ type Theme = {
14
+ [themeKey in ThemeKey]?: ThemeValues;
15
+ };
16
+ type ThemeMode<T = Theme> = {
17
+ [mode: string]: T;
18
+ };
19
+ type ThemeModes<T = Theme> = {
20
+ modes?: ThemeMode<T>;
21
+ };
22
+ type ThemeConfig = Theme | ThemeModes;
14
23
  type Aliases = Record<string, readonly CSSProperty[]>;
15
24
  type PropertiesOptions = readonly ('grid' | ThemeKey)[];
16
- interface Config extends DeepReadonly<{
25
+ interface Config {
17
26
  include: string[];
18
27
  exclude?: string[];
19
28
  grid?: string;
@@ -31,14 +40,15 @@ interface Config extends DeepReadonly<{
31
40
  };
32
41
  };
33
42
  aliases?: Aliases;
34
- theme: Theme;
43
+ themeSelector?: (mode: string) => string;
44
+ theme: ThemeConfig;
35
45
  properties?: Partial<Record<CSSProperty, PropertiesOptions>>;
36
- }> {
37
46
  }
38
47
  declare const defaultConfig: {
39
48
  include: never[];
40
49
  grid: string;
41
50
  responsive: {};
51
+ themeSelector: (mode: string) => string;
42
52
  theme: {};
43
53
  aliases: {};
44
54
  selectors: {
@@ -117,6 +127,7 @@ declare const defaultConfig: {
117
127
  'column-rule-color': "color"[];
118
128
  'column-rule-width': "grid"[];
119
129
  'column-width': ("grid" | "size")[];
130
+ fill: "color"[];
120
131
  'flex-basis': ("grid" | "size")[];
121
132
  'font-family': "font"[];
122
133
  'font-size': "font-size"[];
@@ -178,6 +189,7 @@ declare const defaultConfig: {
178
189
  'scroll-padding-left': "grid"[];
179
190
  'scroll-padding-right': "grid"[];
180
191
  'scroll-padding-top': "grid"[];
192
+ stroke: "color"[];
181
193
  'text-decoration-color': "color"[];
182
194
  'text-shadow': "shadow"[];
183
195
  top: "grid"[];
@@ -188,159 +200,12 @@ declare const defaultConfig: {
188
200
  };
189
201
  };
190
202
  type DefaultConfig = typeof defaultConfig;
203
+ type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
191
204
  type Exact<T, V extends T> = Exclude<keyof V, keyof T> extends never ? V : T;
192
- declare function createConfig<T extends Config>(obj: Exact<Config, T>): {
193
- include: never[];
194
- grid: string;
195
- responsive: {};
196
- theme: {};
197
- aliases: {};
198
- selectors: {
199
- after: string;
200
- before: string;
201
- even: string;
202
- odd: string;
203
- 'first-child': string;
204
- 'last-child': string;
205
- placeholder: string;
206
- hover: string;
207
- focus: string;
208
- 'focus-visible': string;
209
- 'focus-within': string;
210
- active: string;
211
- disabled: string;
212
- };
213
- properties: {
214
- 'accent-color': "color"[];
215
- animation: "anim"[];
216
- 'animation-timing-function': "ease"[];
217
- background: ("color" | "surface")[];
218
- 'background-color': "color"[];
219
- 'background-image': "surface"[];
220
- 'background-position': "grid"[];
221
- 'background-position-x': "grid"[];
222
- 'background-position-y': "grid"[];
223
- 'block-size': ("grid" | "size")[];
224
- border: "border"[];
225
- 'border-block': "border"[];
226
- 'border-block-color': "color"[];
227
- 'border-block-end': "border"[];
228
- 'border-block-end-color': "color"[];
229
- 'border-block-end-style': "line-style"[];
230
- 'border-block-start': "border"[];
231
- 'border-block-start-color': "color"[];
232
- 'border-block-start-style': "line-style"[];
233
- 'border-block-style': "line-style"[];
234
- 'border-bottom': "border"[];
235
- 'border-bottom-color': "color"[];
236
- 'border-bottom-left-radius': "radii"[];
237
- 'border-bottom-right-radius': "radii"[];
238
- 'border-bottom-style': "line-style"[];
239
- 'border-color': "color"[];
240
- 'border-end-end-radius': "radii"[];
241
- 'border-end-start-radius': "radii"[];
242
- 'border-inline': "border"[];
243
- 'border-inline-color': "color"[];
244
- 'border-inline-end': "border"[];
245
- 'border-inline-end-color': "color"[];
246
- 'border-inline-end-style': "line-style"[];
247
- 'border-inline-start': "border"[];
248
- 'border-inline-start-color': "color"[];
249
- 'border-inline-start-style': "line-style"[];
250
- 'border-inline-style': "line-style"[];
251
- 'border-left': "border"[];
252
- 'border-left-color': "color"[];
253
- 'border-left-style': "line-style"[];
254
- 'border-radius': "radii"[];
255
- 'border-right': "border"[];
256
- 'border-right-color': "color"[];
257
- 'border-right-style': "line-style"[];
258
- 'border-start-end-radius': "radii"[];
259
- 'border-start-start-radius': "radii"[];
260
- 'border-style': "line-style"[];
261
- 'border-top': "border"[];
262
- 'border-top-color': "color"[];
263
- 'border-top-left-radius': "radii"[];
264
- 'border-top-right-radius': "radii"[];
265
- 'border-top-style': "line-style"[];
266
- bottom: "grid"[];
267
- 'box-shadow': "shadow"[];
268
- 'caret-color': "color"[];
269
- color: "color"[];
270
- 'column-gap': "grid"[];
271
- 'column-rule-color': "color"[];
272
- 'column-rule-width': "grid"[];
273
- 'column-width': ("grid" | "size")[];
274
- 'flex-basis': ("grid" | "size")[];
275
- 'font-family': "font"[];
276
- 'font-size': "font-size"[];
277
- 'font-weight': "weight"[];
278
- gap: "grid"[];
279
- height: ("grid" | "size")[];
280
- 'inline-size': ("grid" | "size")[];
281
- inset: "grid"[];
282
- 'inset-block': "grid"[];
283
- 'inset-block-end': "grid"[];
284
- 'inset-block-start': "grid"[];
285
- 'inset-inline': "grid"[];
286
- 'inset-inline-end': "grid"[];
287
- 'inset-inline-start': "grid"[];
288
- left: "grid"[];
289
- 'letter-spacing': "tracking"[];
290
- 'line-height': "leading"[];
291
- margin: "grid"[];
292
- 'margin-block': "grid"[];
293
- 'margin-block-end': "grid"[];
294
- 'margin-block-start': "grid"[];
295
- 'margin-bottom': "grid"[];
296
- 'margin-inline': "grid"[];
297
- 'margin-inline-end': "grid"[];
298
- 'margin-inline-start': "grid"[];
299
- 'margin-left': "grid"[];
300
- 'margin-right': "grid"[];
301
- 'margin-top': "grid"[];
302
- 'max-block-size': ("grid" | "size")[];
303
- 'max-height': ("grid" | "size")[];
304
- 'max-inline-size': ("grid" | "size")[];
305
- 'max-width': ("grid" | "size")[];
306
- 'min-block-size': ("grid" | "size")[];
307
- 'min-height': ("grid" | "size")[];
308
- 'min-inline-size': ("grid" | "size")[];
309
- 'min-width': ("grid" | "size")[];
310
- opacity: "alpha"[];
311
- 'outline-color': "color"[];
312
- padding: "grid"[];
313
- 'padding-block': "grid"[];
314
- 'padding-block-end': "grid"[];
315
- 'padding-block-start': "grid"[];
316
- 'padding-bottom': "grid"[];
317
- 'padding-inline': "grid"[];
318
- 'padding-inline-end': "grid"[];
319
- 'padding-inline-start': "grid"[];
320
- 'padding-left': "grid"[];
321
- 'padding-right': "grid"[];
322
- 'padding-top': "grid"[];
323
- right: "grid"[];
324
- 'row-gap': "grid"[];
325
- 'scroll-margin': "grid"[];
326
- 'scroll-margin-bottom': "grid"[];
327
- 'scroll-margin-left': "grid"[];
328
- 'scroll-margin-right': "grid"[];
329
- 'scroll-margin-top': "grid"[];
330
- 'scroll-padding': "grid"[];
331
- 'scroll-padding-bottom': "grid"[];
332
- 'scroll-padding-left': "grid"[];
333
- 'scroll-padding-right': "grid"[];
334
- 'scroll-padding-top': "grid"[];
335
- 'text-decoration-color': "color"[];
336
- 'text-shadow': "shadow"[];
337
- top: "grid"[];
338
- transition: "transition"[];
339
- 'transition-timing-function': "ease"[];
340
- width: ("grid" | "size")[];
341
- 'z-index': "z"[];
342
- };
343
- } & DeepReadonly<T>;
205
+ type MatchingThemeModes<M> = M extends ThemeMode ? {
206
+ theme: ThemeModes<UnionToIntersection<M[keyof M]>>;
207
+ } : {};
208
+ declare function createConfig<T extends Config>(obj: Exact<Config, T> & MatchingThemeModes<T['theme']['modes']>): Omit<DefaultConfig, keyof DeepReadonly<T>> & DeepReadonly<T>;
344
209
 
345
210
  type GridProperty = '--_grid';
346
211
  declare const GridProperty: {
@@ -360,7 +225,7 @@ type VariantProperty<P extends string = string, V extends string = string> = `--
360
225
  declare const VariantProperty: {
361
226
  safeParse: (input: unknown) => Validated<`--${string}_${string}`>;
362
227
  };
363
- declare function variantProperty(variant: string, name: string): TokenProperty;
228
+ declare function variantProperty(variant: string, name: string): VariantProperty;
364
229
  type TokenValue<TK extends string = string, V extends string = string> = `var(--${TK}_${V})`;
365
230
  declare const TokenValue: {
366
231
  safeParse: (input: unknown) => Validated<`var(--${string}_${string})`>;
@@ -468,4 +333,4 @@ declare const mapShorthandToLonghands: {
468
333
  transition: ("transition-delay" | "transition-duration" | "transition-property" | "transition-timing-function")[];
469
334
  };
470
335
 
471
- export { type Aliases, ArbitraryValue, type CSSProperty, type Config, type DeepReadonly, type DefaultConfig, GridProperty, GridValue, type Theme, TokenProperty, TokenValue, VariantProperty, arbitraryValue, createConfig, defaultConfig, getCSSPropertiesForAlias, getTokenPropertyName, getTokenPropertyParts, getTokenPropertySplit, getTokenValueParts, gridProperty, layers, mapShorthandToLonghands, properties, tokenProperty, tokenValue, variantProperty };
336
+ export { type Aliases, ArbitraryValue, type CSSProperty, type Config, type DeepReadonly, type DefaultConfig, GridProperty, GridValue, type Theme, type ThemeModes, TokenProperty, TokenValue, VariantProperty, arbitraryValue, createConfig, defaultConfig, getCSSPropertiesForAlias, getTokenPropertyName, getTokenPropertyParts, getTokenPropertySplit, getTokenValueParts, gridProperty, layers, mapShorthandToLonghands, properties, tokenProperty, tokenValue, variantProperty };
package/dist/index.d.ts CHANGED
@@ -1,19 +1,28 @@
1
- declare const layers: readonly [["all", "-webkit-line-clamp", "accent-color", "align-tracks", "animation", "appearance", "aspect-ratio", "backdrop-filter", "backface-visibility", "background", "border", "border-collapse", "border-spacing", "border-radius", "box-decoration-break", "box-shadow", "box-sizing", "break-after", "break-before", "break-inside", "caption-side", "clear", "clip-path", "color", "color-scheme", "column-fill", "column-span", "column-rule", "columns", "contain", "contain-intrinsic-size", "container", "content", "content-visibility", "counter-increment", "counter-reset", "counter-set", "cursor", "direction", "display", "empty-cells", "filter", "flex", "flex-flow", "float", "font", "font-feature-settings", "font-kerning", "font-language-override", "font-optical-sizing", "font-palette", "font-size-adjust", "font-synthesis", "font-variation-settings", "forced-color-adjust", "gap", "grid", "grid-area", "grid-column", "grid-row", "grid-template", "hanging-punctuation", "height", "hyphenate-character", "hyphenate-limit-chars", "hyphens", "image-orientation", "image-rendering", "image-resolution", "initial-letter", "input-security", "inset", "isolation", "justify-tracks", "letter-spacing", "line-break", "line-clamp", "line-height-step", "list-style", "margin", "mask", "mask-border", "math-depth", "math-shift", "math-style", "max-height", "max-width", "min-height", "min-width", "mix-blend-mode", "object-fit", "object-position", "offset", "opacity", "order", "orphans", "outline", "overflow", "overscroll-behavior", "padding", "page", "paint-order", "perspective", "perspective-origin", "place-content", "place-items", "place-self", "pointer-events", "position", "print-color-adjust", "quotes", "resize", "rotate", "ruby-position", "scale", "scroll-behavior", "scroll-margin", "scroll-padding", "scroll-snap-align", "scroll-snap-stop", "scroll-snap-type", "scroll-timeline", "scrollbar-color", "scrollbar-gutter", "scrollbar-width", "shape-image-threshold", "shape-margin", "shape-outside", "tab-size", "table-layout", "text-align", "text-align-last", "text-combine-upright", "text-decoration", "text-decoration-skip-ink", "text-emphasis", "text-emphasis-position", "text-indent", "text-justify", "text-orientation", "text-overflow", "text-rendering", "text-shadow", "text-size-adjust", "text-transform", "text-underline-offset", "text-underline-position", "touch-action", "transform", "transform-box", "transform-origin", "transform-style", "transition", "translate", "unicode-bidi", "user-select", "vertical-align", "view-transition-name", "visibility", "white-space", "widows", "width", "will-change", "word-break", "word-spacing", "word-wrap", "writing-mode", "z-index", "zoom"], ["animation-composition", "animation-delay", "animation-direction", "animation-duration", "animation-fill-mode", "animation-iteration-count", "animation-name", "animation-play-state", "animation-timeline", "animation-timing-function", "background-attachment", "background-blend-mode", "background-clip", "background-color", "background-image", "background-origin", "background-position", "background-position-x", "background-position-y", "background-repeat", "background-size", "border-top", "border-right", "border-bottom", "border-left", "border-top-left-radius", "border-top-right-radius", "border-bottom-left-radius", "border-bottom-right-radius", "caret-color", "caret-shape", "column-rule-color", "column-rule-style", "column-rule-width", "column-count", "column-width", "contain-intrinsic-width", "contain-intrinsic-height", "container-name", "container-type", "flex-grow", "flex-shrink", "flex-basis", "flex-direction", "flex-wrap", "font-style", "font-variant", "font-weight", "font-stretch", "font-size", "font-family", "row-gap", "column-gap", "grid-auto-columns", "grid-auto-flow", "grid-auto-rows", "grid-template-areas", "grid-template-columns", "grid-template-rows", "grid-row-start", "grid-column-start", "grid-row-end", "grid-column-end", "top", "right", "bottom", "left", "line-height", "list-style-image", "list-style-position", "list-style-type", "margin-top", "margin-right", "margin-bottom", "margin-left", "mask-border-mode", "mask-border-outset", "mask-border-repeat", "mask-border-slice", "mask-border-source", "mask-border-width", "mask-clip", "mask-composite", "mask-image", "mask-mode", "mask-origin", "mask-position", "mask-repeat", "mask-size", "mask-type", "offset-anchor", "offset-distance", "offset-path", "offset-position", "offset-rotate", "outline-color", "outline-offset", "outline-style", "outline-width", "overflow-anchor", "overflow-clip-margin", "overflow-wrap", "overflow-x", "overflow-y", "overscroll-behavior-x", "overscroll-behavior-y", "padding-top", "padding-right", "padding-bottom", "padding-left", "align-content", "justify-content", "align-items", "justify-items", "align-self", "justify-self", "scroll-margin-top", "scroll-margin-right", "scroll-margin-bottom", "scroll-margin-left", "scroll-padding-top", "scroll-padding-right", "scroll-padding-bottom", "scroll-padding-left", "scroll-timeline-axis", "scroll-timeline-name", "text-decoration-color", "text-decoration-line", "text-decoration-style", "text-decoration-thickness", "text-emphasis-color", "text-emphasis-style", "transition-delay", "transition-duration", "transition-property", "transition-timing-function"], ["border-style", "border-color", "border-width", "border-image", "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", "font-variant-emoji", "font-variant-ligatures", "font-variant-numeric", "font-variant-position"], ["border-top-color", "border-top-style", "border-top-width", "border-right-color", "border-right-style", "border-right-width", "border-bottom-color", "border-bottom-style", "border-bottom-width", "border-left-color", "border-left-style", "border-left-width", "border-image-outset", "border-image-repeat", "border-image-slice", "border-image-source", "border-image-width"], ["block-size", "border-block", "border-inline", "contain-intrinsic-block-size", "contain-intrinsic-inline-size", "inline-size", "inset-block", "inset-inline", "margin-block", "margin-inline", "max-block-size", "min-block-size", "max-inline-size", "min-inline-size", "overflow-block", "overflow-inline", "overscroll-behavior-block", "overscroll-behavior-inline", "padding-block", "padding-inline", "scroll-margin-block", "scroll-margin-inline", "scroll-padding-block", "scroll-padding-inline"], ["border-block-width", "border-block-style", "border-block-color", "border-block-start", "border-block-end", "border-inline-color", "border-inline-style", "border-inline-width", "border-inline-start", "border-inline-end", "inset-block-end", "inset-block-start", "inset-inline-end", "inset-inline-start", "margin-block-end", "margin-block-start", "margin-inline-end", "margin-inline-start", "padding-block-end", "padding-block-start", "padding-inline-end", "padding-inline-start", "scroll-margin-block-end", "scroll-margin-block-start", "scroll-margin-inline-end", "scroll-margin-inline-start", "scroll-padding-block-end", "scroll-padding-block-start", "scroll-padding-inline-end", "scroll-padding-inline-start"], ["border-start-end-radius", "border-start-start-radius", "border-end-end-radius", "border-end-start-radius", "border-block-start-color", "border-block-start-style", "border-block-start-width", "border-block-end-color", "border-block-end-style", "border-block-end-width", "border-inline-start-color", "border-inline-start-style", "border-inline-start-width", "border-inline-end-color", "border-inline-end-style", "border-inline-end-width"]];
1
+ declare const layers: readonly [["all", "-webkit-line-clamp", "accent-color", "align-tracks", "animation", "appearance", "aspect-ratio", "backdrop-filter", "backface-visibility", "background", "border", "border-collapse", "border-spacing", "border-radius", "box-decoration-break", "box-shadow", "box-sizing", "break-after", "break-before", "break-inside", "caption-side", "clear", "clip-path", "color", "color-scheme", "column-fill", "column-span", "column-rule", "columns", "contain", "contain-intrinsic-size", "container", "content", "content-visibility", "counter-increment", "counter-reset", "counter-set", "cursor", "direction", "display", "empty-cells", "fill", "filter", "flex", "flex-flow", "float", "font", "font-feature-settings", "font-kerning", "font-language-override", "font-optical-sizing", "font-palette", "font-size-adjust", "font-synthesis", "font-variation-settings", "forced-color-adjust", "gap", "grid", "grid-area", "grid-column", "grid-row", "grid-template", "hanging-punctuation", "height", "hyphenate-character", "hyphenate-limit-chars", "hyphens", "image-orientation", "image-rendering", "image-resolution", "initial-letter", "input-security", "inset", "isolation", "justify-tracks", "letter-spacing", "line-break", "line-clamp", "line-height-step", "list-style", "margin", "mask", "mask-border", "math-depth", "math-shift", "math-style", "max-height", "max-width", "min-height", "min-width", "mix-blend-mode", "object-fit", "object-position", "offset", "opacity", "order", "orphans", "outline", "overflow", "overscroll-behavior", "padding", "page", "paint-order", "perspective", "perspective-origin", "place-content", "place-items", "place-self", "pointer-events", "position", "print-color-adjust", "quotes", "resize", "rotate", "ruby-position", "scale", "scroll-behavior", "scroll-margin", "scroll-padding", "scroll-snap-align", "scroll-snap-stop", "scroll-snap-type", "scroll-timeline", "scrollbar-color", "scrollbar-gutter", "scrollbar-width", "shape-image-threshold", "shape-margin", "shape-outside", "stroke", "tab-size", "table-layout", "text-align", "text-align-last", "text-combine-upright", "text-decoration", "text-decoration-skip-ink", "text-emphasis", "text-emphasis-position", "text-indent", "text-justify", "text-orientation", "text-overflow", "text-rendering", "text-shadow", "text-size-adjust", "text-transform", "text-underline-offset", "text-underline-position", "touch-action", "transform", "transform-box", "transform-origin", "transform-style", "transition", "translate", "unicode-bidi", "user-select", "vertical-align", "view-transition-name", "visibility", "white-space", "widows", "width", "will-change", "word-break", "word-spacing", "word-wrap", "writing-mode", "z-index", "zoom"], ["animation-composition", "animation-delay", "animation-direction", "animation-duration", "animation-fill-mode", "animation-iteration-count", "animation-name", "animation-play-state", "animation-timeline", "animation-timing-function", "background-attachment", "background-blend-mode", "background-clip", "background-color", "background-image", "background-origin", "background-position", "background-position-x", "background-position-y", "background-repeat", "background-size", "border-top", "border-right", "border-bottom", "border-left", "border-top-left-radius", "border-top-right-radius", "border-bottom-left-radius", "border-bottom-right-radius", "caret-color", "caret-shape", "column-rule-color", "column-rule-style", "column-rule-width", "column-count", "column-width", "contain-intrinsic-width", "contain-intrinsic-height", "container-name", "container-type", "flex-grow", "flex-shrink", "flex-basis", "flex-direction", "flex-wrap", "font-style", "font-variant", "font-weight", "font-stretch", "font-size", "font-family", "row-gap", "column-gap", "grid-auto-columns", "grid-auto-flow", "grid-auto-rows", "grid-template-areas", "grid-template-columns", "grid-template-rows", "grid-row-start", "grid-column-start", "grid-row-end", "grid-column-end", "top", "right", "bottom", "left", "line-height", "list-style-image", "list-style-position", "list-style-type", "margin-top", "margin-right", "margin-bottom", "margin-left", "mask-border-mode", "mask-border-outset", "mask-border-repeat", "mask-border-slice", "mask-border-source", "mask-border-width", "mask-clip", "mask-composite", "mask-image", "mask-mode", "mask-origin", "mask-position", "mask-repeat", "mask-size", "mask-type", "offset-anchor", "offset-distance", "offset-path", "offset-position", "offset-rotate", "outline-color", "outline-offset", "outline-style", "outline-width", "overflow-anchor", "overflow-clip-margin", "overflow-wrap", "overflow-x", "overflow-y", "overscroll-behavior-x", "overscroll-behavior-y", "padding-top", "padding-right", "padding-bottom", "padding-left", "align-content", "justify-content", "align-items", "justify-items", "align-self", "justify-self", "scroll-margin-top", "scroll-margin-right", "scroll-margin-bottom", "scroll-margin-left", "scroll-padding-top", "scroll-padding-right", "scroll-padding-bottom", "scroll-padding-left", "scroll-timeline-axis", "scroll-timeline-name", "text-decoration-color", "text-decoration-line", "text-decoration-style", "text-decoration-thickness", "text-emphasis-color", "text-emphasis-style", "transition-delay", "transition-duration", "transition-property", "transition-timing-function"], ["border-style", "border-color", "border-width", "border-image", "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", "font-variant-emoji", "font-variant-ligatures", "font-variant-numeric", "font-variant-position"], ["border-top-color", "border-top-style", "border-top-width", "border-right-color", "border-right-style", "border-right-width", "border-bottom-color", "border-bottom-style", "border-bottom-width", "border-left-color", "border-left-style", "border-left-width", "border-image-outset", "border-image-repeat", "border-image-slice", "border-image-source", "border-image-width"], ["block-size", "border-block", "border-inline", "contain-intrinsic-block-size", "contain-intrinsic-inline-size", "inline-size", "inset-block", "inset-inline", "margin-block", "margin-inline", "max-block-size", "min-block-size", "max-inline-size", "min-inline-size", "overflow-block", "overflow-inline", "overscroll-behavior-block", "overscroll-behavior-inline", "padding-block", "padding-inline", "scroll-margin-block", "scroll-margin-inline", "scroll-padding-block", "scroll-padding-inline"], ["border-block-width", "border-block-style", "border-block-color", "border-block-start", "border-block-end", "border-inline-color", "border-inline-style", "border-inline-width", "border-inline-start", "border-inline-end", "inset-block-end", "inset-block-start", "inset-inline-end", "inset-inline-start", "margin-block-end", "margin-block-start", "margin-inline-end", "margin-inline-start", "padding-block-end", "padding-block-start", "padding-inline-end", "padding-inline-start", "scroll-margin-block-end", "scroll-margin-block-start", "scroll-margin-inline-end", "scroll-margin-inline-start", "scroll-padding-block-end", "scroll-padding-block-start", "scroll-padding-inline-end", "scroll-padding-inline-start"], ["border-start-end-radius", "border-start-start-radius", "border-end-end-radius", "border-end-start-radius", "border-block-start-color", "border-block-start-style", "border-block-start-width", "border-block-end-color", "border-block-end-style", "border-block-end-width", "border-inline-start-color", "border-inline-start-style", "border-inline-start-width", "border-inline-end-color", "border-inline-end-style", "border-inline-end-width"]];
2
2
  type Flatten<T> = {
3
3
  [K in keyof T]: T[K] extends Array<infer E> ? E : T[K];
4
4
  };
5
5
  type CSSProperty = Flatten<typeof layers>[number];
6
6
  declare const properties: CSSProperty;
7
7
 
8
- type DeepReadonly<T> = T extends any[] ? T : {
8
+ type DeepReadonly<T> = T extends Function | any[] ? T : {
9
9
  readonly [P in keyof T]: DeepReadonly<T[P]>;
10
10
  };
11
11
  type ThemeKey = 'alpha' | 'border' | 'color' | 'ease' | 'font-size' | 'leading' | 'line-style' | 'radii' | 'size' | 'shadow' | 'tracking' | 'transition' | 'weight' | 'z' | (string & {});
12
12
  type ThemeValues = Record<string, string>;
13
- type Theme = Partial<Record<ThemeKey, ThemeValues>>;
13
+ type Theme = {
14
+ [themeKey in ThemeKey]?: ThemeValues;
15
+ };
16
+ type ThemeMode<T = Theme> = {
17
+ [mode: string]: T;
18
+ };
19
+ type ThemeModes<T = Theme> = {
20
+ modes?: ThemeMode<T>;
21
+ };
22
+ type ThemeConfig = Theme | ThemeModes;
14
23
  type Aliases = Record<string, readonly CSSProperty[]>;
15
24
  type PropertiesOptions = readonly ('grid' | ThemeKey)[];
16
- interface Config extends DeepReadonly<{
25
+ interface Config {
17
26
  include: string[];
18
27
  exclude?: string[];
19
28
  grid?: string;
@@ -31,14 +40,15 @@ interface Config extends DeepReadonly<{
31
40
  };
32
41
  };
33
42
  aliases?: Aliases;
34
- theme: Theme;
43
+ themeSelector?: (mode: string) => string;
44
+ theme: ThemeConfig;
35
45
  properties?: Partial<Record<CSSProperty, PropertiesOptions>>;
36
- }> {
37
46
  }
38
47
  declare const defaultConfig: {
39
48
  include: never[];
40
49
  grid: string;
41
50
  responsive: {};
51
+ themeSelector: (mode: string) => string;
42
52
  theme: {};
43
53
  aliases: {};
44
54
  selectors: {
@@ -117,6 +127,7 @@ declare const defaultConfig: {
117
127
  'column-rule-color': "color"[];
118
128
  'column-rule-width': "grid"[];
119
129
  'column-width': ("grid" | "size")[];
130
+ fill: "color"[];
120
131
  'flex-basis': ("grid" | "size")[];
121
132
  'font-family': "font"[];
122
133
  'font-size': "font-size"[];
@@ -178,6 +189,7 @@ declare const defaultConfig: {
178
189
  'scroll-padding-left': "grid"[];
179
190
  'scroll-padding-right': "grid"[];
180
191
  'scroll-padding-top': "grid"[];
192
+ stroke: "color"[];
181
193
  'text-decoration-color': "color"[];
182
194
  'text-shadow': "shadow"[];
183
195
  top: "grid"[];
@@ -188,159 +200,12 @@ declare const defaultConfig: {
188
200
  };
189
201
  };
190
202
  type DefaultConfig = typeof defaultConfig;
203
+ type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
191
204
  type Exact<T, V extends T> = Exclude<keyof V, keyof T> extends never ? V : T;
192
- declare function createConfig<T extends Config>(obj: Exact<Config, T>): {
193
- include: never[];
194
- grid: string;
195
- responsive: {};
196
- theme: {};
197
- aliases: {};
198
- selectors: {
199
- after: string;
200
- before: string;
201
- even: string;
202
- odd: string;
203
- 'first-child': string;
204
- 'last-child': string;
205
- placeholder: string;
206
- hover: string;
207
- focus: string;
208
- 'focus-visible': string;
209
- 'focus-within': string;
210
- active: string;
211
- disabled: string;
212
- };
213
- properties: {
214
- 'accent-color': "color"[];
215
- animation: "anim"[];
216
- 'animation-timing-function': "ease"[];
217
- background: ("color" | "surface")[];
218
- 'background-color': "color"[];
219
- 'background-image': "surface"[];
220
- 'background-position': "grid"[];
221
- 'background-position-x': "grid"[];
222
- 'background-position-y': "grid"[];
223
- 'block-size': ("grid" | "size")[];
224
- border: "border"[];
225
- 'border-block': "border"[];
226
- 'border-block-color': "color"[];
227
- 'border-block-end': "border"[];
228
- 'border-block-end-color': "color"[];
229
- 'border-block-end-style': "line-style"[];
230
- 'border-block-start': "border"[];
231
- 'border-block-start-color': "color"[];
232
- 'border-block-start-style': "line-style"[];
233
- 'border-block-style': "line-style"[];
234
- 'border-bottom': "border"[];
235
- 'border-bottom-color': "color"[];
236
- 'border-bottom-left-radius': "radii"[];
237
- 'border-bottom-right-radius': "radii"[];
238
- 'border-bottom-style': "line-style"[];
239
- 'border-color': "color"[];
240
- 'border-end-end-radius': "radii"[];
241
- 'border-end-start-radius': "radii"[];
242
- 'border-inline': "border"[];
243
- 'border-inline-color': "color"[];
244
- 'border-inline-end': "border"[];
245
- 'border-inline-end-color': "color"[];
246
- 'border-inline-end-style': "line-style"[];
247
- 'border-inline-start': "border"[];
248
- 'border-inline-start-color': "color"[];
249
- 'border-inline-start-style': "line-style"[];
250
- 'border-inline-style': "line-style"[];
251
- 'border-left': "border"[];
252
- 'border-left-color': "color"[];
253
- 'border-left-style': "line-style"[];
254
- 'border-radius': "radii"[];
255
- 'border-right': "border"[];
256
- 'border-right-color': "color"[];
257
- 'border-right-style': "line-style"[];
258
- 'border-start-end-radius': "radii"[];
259
- 'border-start-start-radius': "radii"[];
260
- 'border-style': "line-style"[];
261
- 'border-top': "border"[];
262
- 'border-top-color': "color"[];
263
- 'border-top-left-radius': "radii"[];
264
- 'border-top-right-radius': "radii"[];
265
- 'border-top-style': "line-style"[];
266
- bottom: "grid"[];
267
- 'box-shadow': "shadow"[];
268
- 'caret-color': "color"[];
269
- color: "color"[];
270
- 'column-gap': "grid"[];
271
- 'column-rule-color': "color"[];
272
- 'column-rule-width': "grid"[];
273
- 'column-width': ("grid" | "size")[];
274
- 'flex-basis': ("grid" | "size")[];
275
- 'font-family': "font"[];
276
- 'font-size': "font-size"[];
277
- 'font-weight': "weight"[];
278
- gap: "grid"[];
279
- height: ("grid" | "size")[];
280
- 'inline-size': ("grid" | "size")[];
281
- inset: "grid"[];
282
- 'inset-block': "grid"[];
283
- 'inset-block-end': "grid"[];
284
- 'inset-block-start': "grid"[];
285
- 'inset-inline': "grid"[];
286
- 'inset-inline-end': "grid"[];
287
- 'inset-inline-start': "grid"[];
288
- left: "grid"[];
289
- 'letter-spacing': "tracking"[];
290
- 'line-height': "leading"[];
291
- margin: "grid"[];
292
- 'margin-block': "grid"[];
293
- 'margin-block-end': "grid"[];
294
- 'margin-block-start': "grid"[];
295
- 'margin-bottom': "grid"[];
296
- 'margin-inline': "grid"[];
297
- 'margin-inline-end': "grid"[];
298
- 'margin-inline-start': "grid"[];
299
- 'margin-left': "grid"[];
300
- 'margin-right': "grid"[];
301
- 'margin-top': "grid"[];
302
- 'max-block-size': ("grid" | "size")[];
303
- 'max-height': ("grid" | "size")[];
304
- 'max-inline-size': ("grid" | "size")[];
305
- 'max-width': ("grid" | "size")[];
306
- 'min-block-size': ("grid" | "size")[];
307
- 'min-height': ("grid" | "size")[];
308
- 'min-inline-size': ("grid" | "size")[];
309
- 'min-width': ("grid" | "size")[];
310
- opacity: "alpha"[];
311
- 'outline-color': "color"[];
312
- padding: "grid"[];
313
- 'padding-block': "grid"[];
314
- 'padding-block-end': "grid"[];
315
- 'padding-block-start': "grid"[];
316
- 'padding-bottom': "grid"[];
317
- 'padding-inline': "grid"[];
318
- 'padding-inline-end': "grid"[];
319
- 'padding-inline-start': "grid"[];
320
- 'padding-left': "grid"[];
321
- 'padding-right': "grid"[];
322
- 'padding-top': "grid"[];
323
- right: "grid"[];
324
- 'row-gap': "grid"[];
325
- 'scroll-margin': "grid"[];
326
- 'scroll-margin-bottom': "grid"[];
327
- 'scroll-margin-left': "grid"[];
328
- 'scroll-margin-right': "grid"[];
329
- 'scroll-margin-top': "grid"[];
330
- 'scroll-padding': "grid"[];
331
- 'scroll-padding-bottom': "grid"[];
332
- 'scroll-padding-left': "grid"[];
333
- 'scroll-padding-right': "grid"[];
334
- 'scroll-padding-top': "grid"[];
335
- 'text-decoration-color': "color"[];
336
- 'text-shadow': "shadow"[];
337
- top: "grid"[];
338
- transition: "transition"[];
339
- 'transition-timing-function': "ease"[];
340
- width: ("grid" | "size")[];
341
- 'z-index': "z"[];
342
- };
343
- } & DeepReadonly<T>;
205
+ type MatchingThemeModes<M> = M extends ThemeMode ? {
206
+ theme: ThemeModes<UnionToIntersection<M[keyof M]>>;
207
+ } : {};
208
+ declare function createConfig<T extends Config>(obj: Exact<Config, T> & MatchingThemeModes<T['theme']['modes']>): Omit<DefaultConfig, keyof DeepReadonly<T>> & DeepReadonly<T>;
344
209
 
345
210
  type GridProperty = '--_grid';
346
211
  declare const GridProperty: {
@@ -360,7 +225,7 @@ type VariantProperty<P extends string = string, V extends string = string> = `--
360
225
  declare const VariantProperty: {
361
226
  safeParse: (input: unknown) => Validated<`--${string}_${string}`>;
362
227
  };
363
- declare function variantProperty(variant: string, name: string): TokenProperty;
228
+ declare function variantProperty(variant: string, name: string): VariantProperty;
364
229
  type TokenValue<TK extends string = string, V extends string = string> = `var(--${TK}_${V})`;
365
230
  declare const TokenValue: {
366
231
  safeParse: (input: unknown) => Validated<`var(--${string}_${string})`>;
@@ -468,4 +333,4 @@ declare const mapShorthandToLonghands: {
468
333
  transition: ("transition-delay" | "transition-duration" | "transition-property" | "transition-timing-function")[];
469
334
  };
470
335
 
471
- export { type Aliases, ArbitraryValue, type CSSProperty, type Config, type DeepReadonly, type DefaultConfig, GridProperty, GridValue, type Theme, TokenProperty, TokenValue, VariantProperty, arbitraryValue, createConfig, defaultConfig, getCSSPropertiesForAlias, getTokenPropertyName, getTokenPropertyParts, getTokenPropertySplit, getTokenValueParts, gridProperty, layers, mapShorthandToLonghands, properties, tokenProperty, tokenValue, variantProperty };
336
+ export { type Aliases, ArbitraryValue, type CSSProperty, type Config, type DeepReadonly, type DefaultConfig, GridProperty, GridValue, type Theme, type ThemeModes, TokenProperty, TokenValue, VariantProperty, arbitraryValue, createConfig, defaultConfig, getCSSPropertiesForAlias, getTokenPropertyName, getTokenPropertyParts, getTokenPropertySplit, getTokenValueParts, gridProperty, layers, mapShorthandToLonghands, properties, tokenProperty, tokenValue, variantProperty };
package/dist/index.js CHANGED
@@ -49,6 +49,7 @@ var defaultConfig = {
49
49
  include: [],
50
50
  grid: "0.25rem",
51
51
  responsive: {},
52
+ themeSelector: (mode) => mode === "root" ? ":root" : `.theme-${mode}`,
52
53
  theme: {},
53
54
  aliases: {},
54
55
  selectors: {
@@ -127,6 +128,7 @@ var defaultConfig = {
127
128
  "column-rule-color": ["color"],
128
129
  "column-rule-width": ["grid"],
129
130
  "column-width": ["grid", "size"],
131
+ fill: ["color"],
130
132
  "flex-basis": ["grid", "size"],
131
133
  "font-family": ["font"],
132
134
  "font-size": ["font-size"],
@@ -188,6 +190,7 @@ var defaultConfig = {
188
190
  "scroll-padding-left": ["grid"],
189
191
  "scroll-padding-right": ["grid"],
190
192
  "scroll-padding-top": ["grid"],
193
+ stroke: ["color"],
191
194
  "text-decoration-color": ["color"],
192
195
  "text-shadow": ["shadow"],
193
196
  top: ["grid"],
@@ -328,6 +331,7 @@ var layers = [
328
331
  "direction",
329
332
  "display",
330
333
  "empty-cells",
334
+ "fill",
331
335
  "filter",
332
336
  "flex",
333
337
  "flex-flow",
@@ -415,6 +419,7 @@ var layers = [
415
419
  "shape-image-threshold",
416
420
  "shape-margin",
417
421
  "shape-outside",
422
+ "stroke",
418
423
  "tab-size",
419
424
  "table-layout",
420
425
  "text-align",
package/dist/index.mjs CHANGED
@@ -3,6 +3,7 @@ var defaultConfig = {
3
3
  include: [],
4
4
  grid: "0.25rem",
5
5
  responsive: {},
6
+ themeSelector: (mode) => mode === "root" ? ":root" : `.theme-${mode}`,
6
7
  theme: {},
7
8
  aliases: {},
8
9
  selectors: {
@@ -81,6 +82,7 @@ var defaultConfig = {
81
82
  "column-rule-color": ["color"],
82
83
  "column-rule-width": ["grid"],
83
84
  "column-width": ["grid", "size"],
85
+ fill: ["color"],
84
86
  "flex-basis": ["grid", "size"],
85
87
  "font-family": ["font"],
86
88
  "font-size": ["font-size"],
@@ -142,6 +144,7 @@ var defaultConfig = {
142
144
  "scroll-padding-left": ["grid"],
143
145
  "scroll-padding-right": ["grid"],
144
146
  "scroll-padding-top": ["grid"],
147
+ stroke: ["color"],
145
148
  "text-decoration-color": ["color"],
146
149
  "text-shadow": ["shadow"],
147
150
  top: ["grid"],
@@ -282,6 +285,7 @@ var layers = [
282
285
  "direction",
283
286
  "display",
284
287
  "empty-cells",
288
+ "fill",
285
289
  "filter",
286
290
  "flex",
287
291
  "flex-flow",
@@ -369,6 +373,7 @@ var layers = [
369
373
  "shape-image-threshold",
370
374
  "shape-margin",
371
375
  "shape-outside",
376
+ "stroke",
372
377
  "tab-size",
373
378
  "table-layout",
374
379
  "text-align",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokenami/config",
3
- "version": "0.0.35",
3
+ "version": "0.0.37",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -14,7 +14,7 @@
14
14
  "csstype": "^3.1.2",
15
15
  "tsup": "^7.0.0",
16
16
  "typescript": "^5.1.3",
17
- "@tokenami/dev": "0.0.35"
17
+ "@tokenami/dev": "0.0.37"
18
18
  },
19
19
  "scripts": {
20
20
  "build": "tsup src/index.ts --format=esm,cjs --dts",