@unocss/preset-mini 0.55.1 → 0.55.2
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/colors.cjs +360 -6
- package/dist/{colors-dabdd21f.d.ts → colors.d.cts} +3 -2
- package/dist/colors.d.mts +354 -0
- package/dist/colors.d.ts +353 -2
- package/dist/colors.mjs +361 -1
- package/dist/index.cjs +12 -12
- package/dist/index.d.cts +69 -0
- package/dist/index.d.mts +69 -0
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +9 -10
- package/dist/rules.cjs +928 -48
- package/dist/rules.d.cts +133 -0
- package/dist/rules.d.mts +133 -0
- package/dist/rules.d.ts +1 -1
- package/dist/rules.mjs +891 -4
- package/dist/{default-1f25a0ae.d.ts → shared/preset-mini.024bdcea.d.ts} +1 -1
- package/dist/shared/preset-mini.0a9763df.d.mts +721 -0
- package/dist/shared/preset-mini.0fac4963.mjs +320 -0
- package/dist/shared/preset-mini.5bfee53b.cjs +344 -0
- package/dist/shared/preset-mini.5f54784f.d.mts +71 -0
- package/dist/shared/preset-mini.5f54784f.d.ts +71 -0
- package/dist/shared/preset-mini.aa3a264b.d.cts +67 -0
- package/dist/shared/{preset-mini.a21c5071.cjs → preset-mini.b4ad509c.cjs} +12 -8
- package/dist/shared/preset-mini.d69a12a5.d.cts +721 -0
- package/dist/{utilities-d496540e.d.ts → shared/preset-mini.e93c20db.d.ts} +1 -1
- package/dist/shared/{preset-mini.6c1c8016.mjs → preset-mini.f1fe435e.mjs} +13 -9
- package/dist/shared/preset-mini.fc26b619.d.mts +67 -0
- package/dist/theme.cjs +308 -34
- package/dist/theme.d.cts +264 -0
- package/dist/theme.d.mts +264 -0
- package/dist/theme.d.ts +5 -5
- package/dist/theme.mjs +284 -4
- package/dist/utils.cjs +81 -10
- package/dist/utils.d.cts +83 -0
- package/dist/utils.d.mts +83 -0
- package/dist/utils.d.ts +20 -20
- package/dist/utils.mjs +81 -3
- package/dist/variants.cjs +737 -33
- package/dist/variants.d.cts +46 -0
- package/dist/variants.d.mts +46 -0
- package/dist/variants.d.ts +4 -4
- package/dist/variants.mjs +714 -4
- package/package.json +3 -3
- package/dist/shared/preset-mini.0131b915.mjs +0 -704
- package/dist/shared/preset-mini.1c66bf79.mjs +0 -361
- package/dist/shared/preset-mini.74f9d55e.mjs +0 -80
- package/dist/shared/preset-mini.811eb23d.mjs +0 -681
- package/dist/shared/preset-mini.8dd73081.mjs +0 -452
- package/dist/shared/preset-mini.9d93761b.cjs +0 -729
- package/dist/shared/preset-mini.b8d9397e.cjs +0 -471
- package/dist/shared/preset-mini.ce5169f2.cjs +0 -730
- package/dist/shared/preset-mini.d778b487.cjs +0 -85
- package/dist/shared/preset-mini.de3bd9f7.mjs +0 -284
- package/dist/shared/preset-mini.e078d7da.cjs +0 -313
- package/dist/shared/preset-mini.f3fc54d2.cjs +0 -363
- /package/dist/{types-d991ba46.d.ts → shared/preset-mini.5f54784f.d.cts} +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Arrayable } from '@unocss/core';
|
|
2
|
+
|
|
3
|
+
interface ThemeAnimation {
|
|
4
|
+
keyframes?: Record<string, string>;
|
|
5
|
+
durations?: Record<string, string>;
|
|
6
|
+
timingFns?: Record<string, string>;
|
|
7
|
+
properties?: Record<string, object>;
|
|
8
|
+
counts?: Record<string, string | number>;
|
|
9
|
+
}
|
|
10
|
+
interface Colors {
|
|
11
|
+
[key: string]: Colors & {
|
|
12
|
+
DEFAULT?: string;
|
|
13
|
+
} | string;
|
|
14
|
+
}
|
|
15
|
+
interface Theme {
|
|
16
|
+
width?: Record<string, string>;
|
|
17
|
+
height?: Record<string, string>;
|
|
18
|
+
maxWidth?: Record<string, string>;
|
|
19
|
+
maxHeight?: Record<string, string>;
|
|
20
|
+
minWidth?: Record<string, string>;
|
|
21
|
+
minHeight?: Record<string, string>;
|
|
22
|
+
inlineSize?: Record<string, string>;
|
|
23
|
+
blockSize?: Record<string, string>;
|
|
24
|
+
maxInlineSize?: Record<string, string>;
|
|
25
|
+
maxBlockSize?: Record<string, string>;
|
|
26
|
+
minInlineSize?: Record<string, string>;
|
|
27
|
+
minBlockSize?: Record<string, string>;
|
|
28
|
+
borderRadius?: Record<string, string>;
|
|
29
|
+
breakpoints?: Record<string, string>;
|
|
30
|
+
verticalBreakpoints?: Record<string, string>;
|
|
31
|
+
colors?: Colors;
|
|
32
|
+
fontFamily?: Record<string, string>;
|
|
33
|
+
fontSize?: Record<string, string | [string, string]>;
|
|
34
|
+
fontWeight?: Record<string, string>;
|
|
35
|
+
lineHeight?: Record<string, string>;
|
|
36
|
+
letterSpacing?: Record<string, string>;
|
|
37
|
+
wordSpacing?: Record<string, string>;
|
|
38
|
+
boxShadow?: Record<string, string | string[]>;
|
|
39
|
+
textIndent?: Record<string, string>;
|
|
40
|
+
textShadow?: Record<string, string | string[]>;
|
|
41
|
+
textStrokeWidth?: Record<string, string>;
|
|
42
|
+
ringWidth?: Record<string, string>;
|
|
43
|
+
lineWidth?: Record<string, string>;
|
|
44
|
+
spacing?: Record<string, string>;
|
|
45
|
+
duration?: Record<string, string>;
|
|
46
|
+
aria?: Record<string, string>;
|
|
47
|
+
data?: Record<string, string>;
|
|
48
|
+
blur?: Record<string, string>;
|
|
49
|
+
dropShadow?: Record<string, string | string[]>;
|
|
50
|
+
easing?: Record<string, string>;
|
|
51
|
+
media?: Record<string, string>;
|
|
52
|
+
supports?: Record<string, string>;
|
|
53
|
+
containers?: Record<string, string>;
|
|
54
|
+
animation?: ThemeAnimation;
|
|
55
|
+
gridAutoColumn?: Record<string, string>;
|
|
56
|
+
gridAutoRow?: Record<string, string>;
|
|
57
|
+
gridColumn?: Record<string, string>;
|
|
58
|
+
gridRow?: Record<string, string>;
|
|
59
|
+
gridTemplateColumn?: Record<string, string>;
|
|
60
|
+
gridTemplateRow?: Record<string, string>;
|
|
61
|
+
container?: {
|
|
62
|
+
center?: boolean;
|
|
63
|
+
padding?: string | Record<string, string>;
|
|
64
|
+
maxWidth?: Record<string, string>;
|
|
65
|
+
};
|
|
66
|
+
/** Used to generate CSS variables placeholder in preflight */
|
|
67
|
+
preflightRoot?: Arrayable<string>;
|
|
68
|
+
preflightBase?: Record<string, string | number>;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export { Colors as C, Theme as T, ThemeAnimation as a };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Arrayable } from '@unocss/core';
|
|
2
|
+
|
|
3
|
+
interface ThemeAnimation {
|
|
4
|
+
keyframes?: Record<string, string>;
|
|
5
|
+
durations?: Record<string, string>;
|
|
6
|
+
timingFns?: Record<string, string>;
|
|
7
|
+
properties?: Record<string, object>;
|
|
8
|
+
counts?: Record<string, string | number>;
|
|
9
|
+
}
|
|
10
|
+
interface Colors {
|
|
11
|
+
[key: string]: Colors & {
|
|
12
|
+
DEFAULT?: string;
|
|
13
|
+
} | string;
|
|
14
|
+
}
|
|
15
|
+
interface Theme {
|
|
16
|
+
width?: Record<string, string>;
|
|
17
|
+
height?: Record<string, string>;
|
|
18
|
+
maxWidth?: Record<string, string>;
|
|
19
|
+
maxHeight?: Record<string, string>;
|
|
20
|
+
minWidth?: Record<string, string>;
|
|
21
|
+
minHeight?: Record<string, string>;
|
|
22
|
+
inlineSize?: Record<string, string>;
|
|
23
|
+
blockSize?: Record<string, string>;
|
|
24
|
+
maxInlineSize?: Record<string, string>;
|
|
25
|
+
maxBlockSize?: Record<string, string>;
|
|
26
|
+
minInlineSize?: Record<string, string>;
|
|
27
|
+
minBlockSize?: Record<string, string>;
|
|
28
|
+
borderRadius?: Record<string, string>;
|
|
29
|
+
breakpoints?: Record<string, string>;
|
|
30
|
+
verticalBreakpoints?: Record<string, string>;
|
|
31
|
+
colors?: Colors;
|
|
32
|
+
fontFamily?: Record<string, string>;
|
|
33
|
+
fontSize?: Record<string, string | [string, string]>;
|
|
34
|
+
fontWeight?: Record<string, string>;
|
|
35
|
+
lineHeight?: Record<string, string>;
|
|
36
|
+
letterSpacing?: Record<string, string>;
|
|
37
|
+
wordSpacing?: Record<string, string>;
|
|
38
|
+
boxShadow?: Record<string, string | string[]>;
|
|
39
|
+
textIndent?: Record<string, string>;
|
|
40
|
+
textShadow?: Record<string, string | string[]>;
|
|
41
|
+
textStrokeWidth?: Record<string, string>;
|
|
42
|
+
ringWidth?: Record<string, string>;
|
|
43
|
+
lineWidth?: Record<string, string>;
|
|
44
|
+
spacing?: Record<string, string>;
|
|
45
|
+
duration?: Record<string, string>;
|
|
46
|
+
aria?: Record<string, string>;
|
|
47
|
+
data?: Record<string, string>;
|
|
48
|
+
blur?: Record<string, string>;
|
|
49
|
+
dropShadow?: Record<string, string | string[]>;
|
|
50
|
+
easing?: Record<string, string>;
|
|
51
|
+
media?: Record<string, string>;
|
|
52
|
+
supports?: Record<string, string>;
|
|
53
|
+
containers?: Record<string, string>;
|
|
54
|
+
animation?: ThemeAnimation;
|
|
55
|
+
gridAutoColumn?: Record<string, string>;
|
|
56
|
+
gridAutoRow?: Record<string, string>;
|
|
57
|
+
gridColumn?: Record<string, string>;
|
|
58
|
+
gridRow?: Record<string, string>;
|
|
59
|
+
gridTemplateColumn?: Record<string, string>;
|
|
60
|
+
gridTemplateRow?: Record<string, string>;
|
|
61
|
+
container?: {
|
|
62
|
+
center?: boolean;
|
|
63
|
+
padding?: string | Record<string, string>;
|
|
64
|
+
maxWidth?: Record<string, string>;
|
|
65
|
+
};
|
|
66
|
+
/** Used to generate CSS variables placeholder in preflight */
|
|
67
|
+
preflightRoot?: Arrayable<string>;
|
|
68
|
+
preflightBase?: Record<string, string | number>;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export { Colors as C, Theme as T, ThemeAnimation as a };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { DynamicMatcher, ParsedColorValue, CSSObject, VariantContext, StaticRule } from '@unocss/core';
|
|
2
|
+
import { T as Theme } from './preset-mini.5f54784f.cjs';
|
|
3
|
+
|
|
4
|
+
declare const CONTROL_MINI_NO_NEGATIVE = "$$mini-no-negative";
|
|
5
|
+
/**
|
|
6
|
+
* Provide {@link DynamicMatcher} function returning spacing definition. See spacing rules.
|
|
7
|
+
*
|
|
8
|
+
* @param {string} propertyPrefix - Property for the css value to be created. Postfix will be appended according to direction matched.
|
|
9
|
+
* @see {@link directionMap}
|
|
10
|
+
*/
|
|
11
|
+
declare function directionSize(propertyPrefix: string): DynamicMatcher;
|
|
12
|
+
/**
|
|
13
|
+
* Split utility shorthand delimited by / or :
|
|
14
|
+
*/
|
|
15
|
+
declare function splitShorthand(body: string, type: string): string[];
|
|
16
|
+
/**
|
|
17
|
+
* Parse color string into {@link ParsedColorValue} (if possible). Color value will first be matched to theme object before parsing.
|
|
18
|
+
* See also color.tests.ts for more examples.
|
|
19
|
+
*
|
|
20
|
+
* @example Parseable strings:
|
|
21
|
+
* 'red' // From theme, if 'red' is available
|
|
22
|
+
* 'red-100' // From theme, plus scale
|
|
23
|
+
* 'red-100/20' // From theme, plus scale/opacity
|
|
24
|
+
* '[rgb(100,2,3)]/[var(--op)]' // Bracket with rgb color and bracket with opacity
|
|
25
|
+
*
|
|
26
|
+
* @param {string} body - Color string to be parsed.
|
|
27
|
+
* @param {Theme} theme - {@link Theme} object.
|
|
28
|
+
* @return {ParsedColorValue|undefined} {@link ParsedColorValue} object if string is parseable.
|
|
29
|
+
*/
|
|
30
|
+
declare function parseColor(body: string, theme: Theme): ParsedColorValue | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Provide {@link DynamicMatcher} function to produce color value matched from rule.
|
|
33
|
+
*
|
|
34
|
+
* @see {@link parseColor}
|
|
35
|
+
*
|
|
36
|
+
* @example Resolving 'red' from theme:
|
|
37
|
+
* colorResolver('background-color', 'background')('', 'red')
|
|
38
|
+
* return { 'background-color': '#f12' }
|
|
39
|
+
*
|
|
40
|
+
* @example Resolving 'red-100' from theme:
|
|
41
|
+
* colorResolver('background-color', 'background')('', 'red-100')
|
|
42
|
+
* return { '--un-background-opacity': '1', 'background-color': 'rgba(254,226,226,var(--un-background-opacity))' }
|
|
43
|
+
*
|
|
44
|
+
* @example Resolving 'red-100/20' from theme:
|
|
45
|
+
* colorResolver('background-color', 'background')('', 'red-100/20')
|
|
46
|
+
* return { 'background-color': 'rgba(204,251,241,0.22)' }
|
|
47
|
+
*
|
|
48
|
+
* @example Resolving 'hex-124':
|
|
49
|
+
* colorResolver('color', 'text')('', 'hex-124')
|
|
50
|
+
* return { '--un-text-opacity': '1', 'color': 'rgba(17,34,68,var(--un-text-opacity))' }
|
|
51
|
+
*
|
|
52
|
+
* @param {string} property - Property for the css value to be created.
|
|
53
|
+
* @param {string} varName - Base name for the opacity variable.
|
|
54
|
+
* @param {function} [shouldPass] - Function to decide whether to pass the css.
|
|
55
|
+
* @return {@link DynamicMatcher} object.
|
|
56
|
+
*/
|
|
57
|
+
declare function colorResolver(property: string, varName: string, shouldPass?: (css: CSSObject) => boolean): DynamicMatcher;
|
|
58
|
+
declare function colorableShadows(shadows: string | string[], colorVar: string): string[];
|
|
59
|
+
declare function hasParseableColor(color: string | undefined, theme: Theme): boolean;
|
|
60
|
+
declare function resolveBreakpoints({ theme, generator }: Readonly<VariantContext<Theme>>): Record<string, string> | undefined;
|
|
61
|
+
declare function resolveVerticalBreakpoints({ theme, generator }: Readonly<VariantContext<Theme>>): Record<string, string> | undefined;
|
|
62
|
+
declare function makeGlobalStaticRules(prefix: string, property?: string): StaticRule[];
|
|
63
|
+
declare function getBracket(str: string, open: string, close: string): string[] | undefined;
|
|
64
|
+
declare function getComponent(str: string, open: string, close: string, separators: string | string[]): string[] | undefined;
|
|
65
|
+
declare function getComponents(str: string, separators: string | string[], limit?: number): string[] | undefined;
|
|
66
|
+
|
|
67
|
+
export { CONTROL_MINI_NO_NEGATIVE as C, colorableShadows as a, resolveVerticalBreakpoints as b, colorResolver as c, directionSize as d, getComponent as e, getComponents as f, getBracket as g, hasParseableColor as h, makeGlobalStaticRules as m, parseColor as p, resolveBreakpoints as r, splitShorthand as s };
|
|
@@ -113,6 +113,7 @@ const numberRE = /^(-?\d*(?:\.\d+)?)$/i;
|
|
|
113
113
|
const unitOnlyRE = /^(px)$/i;
|
|
114
114
|
|
|
115
115
|
const cssProps = [
|
|
116
|
+
// basic props
|
|
116
117
|
"color",
|
|
117
118
|
"border-color",
|
|
118
119
|
"background-color",
|
|
@@ -130,12 +131,14 @@ const cssProps = [
|
|
|
130
131
|
"text-shadow",
|
|
131
132
|
"transform",
|
|
132
133
|
"box-shadow",
|
|
134
|
+
// positions
|
|
133
135
|
"background-position",
|
|
134
136
|
"left",
|
|
135
137
|
"right",
|
|
136
138
|
"top",
|
|
137
139
|
"bottom",
|
|
138
140
|
"object-position",
|
|
141
|
+
// sizes
|
|
139
142
|
"max-height",
|
|
140
143
|
"min-height",
|
|
141
144
|
"max-width",
|
|
@@ -154,6 +157,7 @@ const cssProps = [
|
|
|
154
157
|
"border-spacing",
|
|
155
158
|
"letter-spacing",
|
|
156
159
|
"word-spacing",
|
|
160
|
+
// enhances
|
|
157
161
|
"stroke",
|
|
158
162
|
"filter",
|
|
159
163
|
"backdrop-filter",
|
|
@@ -337,23 +341,23 @@ function position(str) {
|
|
|
337
341
|
|
|
338
342
|
const valueHandlers = {
|
|
339
343
|
__proto__: null,
|
|
340
|
-
numberWithUnit: numberWithUnit,
|
|
341
344
|
auto: auto,
|
|
342
|
-
rem: rem,
|
|
343
|
-
px: px,
|
|
344
|
-
number: number,
|
|
345
|
-
percent: percent,
|
|
346
|
-
fraction: fraction,
|
|
347
345
|
bracket: bracket,
|
|
348
346
|
bracketOfColor: bracketOfColor,
|
|
349
347
|
bracketOfLength: bracketOfLength,
|
|
350
348
|
bracketOfPosition: bracketOfPosition,
|
|
351
349
|
cssvar: cssvar,
|
|
352
|
-
time: time,
|
|
353
350
|
degree: degree,
|
|
351
|
+
fraction: fraction,
|
|
354
352
|
global: global,
|
|
353
|
+
number: number,
|
|
354
|
+
numberWithUnit: numberWithUnit,
|
|
355
|
+
percent: percent,
|
|
356
|
+
position: position,
|
|
355
357
|
properties: properties,
|
|
356
|
-
|
|
358
|
+
px: px,
|
|
359
|
+
rem: rem,
|
|
360
|
+
time: time
|
|
357
361
|
};
|
|
358
362
|
|
|
359
363
|
const handler = core.createValueHandler(valueHandlers);
|