@unocss/preset-wind 0.24.4 → 0.26.1
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.cjs +31 -4
- package/dist/index.mjs +32 -5
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -903,6 +903,25 @@ const theme = {
|
|
|
903
903
|
"zoom-out-right": { "transform-origin": "right center" },
|
|
904
904
|
"zoom-out-up": { "transform-origin": "center bottom" }
|
|
905
905
|
}
|
|
906
|
+
},
|
|
907
|
+
media: {
|
|
908
|
+
portrait: "(orientation: portrait)",
|
|
909
|
+
landscape: "(orientation: landscape)",
|
|
910
|
+
os_dark: "(prefers-color-scheme: dark)",
|
|
911
|
+
os_light: "(prefers-color-scheme: light)",
|
|
912
|
+
motion_ok: "(prefers-reduced-motion: no-preference)",
|
|
913
|
+
motion_not_ok: "(prefers-reduced-motion: reduce)",
|
|
914
|
+
high_contrast: "(prefers-contrast: high)",
|
|
915
|
+
low_contrast: "(prefers-contrast: low)",
|
|
916
|
+
opacity_ok: "(prefers-reduced-transparency: no-preference)",
|
|
917
|
+
opacity_not_ok: "(prefers-reduced-transparency: reduce)",
|
|
918
|
+
useData_ok: "(prefers-reduced-data: no-preference)",
|
|
919
|
+
useData_not_ok: "(prefers-reduced-data: reduce)",
|
|
920
|
+
touch: "(hover: none) and (pointer: coarse)",
|
|
921
|
+
stylus: "(hover: none) and (pointer: fine)",
|
|
922
|
+
pointer: "(hover) and (pointer: coarse)",
|
|
923
|
+
mouse: "(hover) and (pointer: fine)",
|
|
924
|
+
hd_color: "(dynamic-range: high)"
|
|
906
925
|
}
|
|
907
926
|
};
|
|
908
927
|
|
|
@@ -917,6 +936,15 @@ const variantColorsScheme = [
|
|
|
917
936
|
utils.variantParentMatcher("@light", "@media (prefers-color-scheme: light)")
|
|
918
937
|
];
|
|
919
938
|
|
|
939
|
+
const variantMotions = [
|
|
940
|
+
utils.variantParentMatcher("motion-reduce", "@media (prefers-reduced-motion: reduce)"),
|
|
941
|
+
utils.variantParentMatcher("motion-safe", "@media (prefers-reduced-motion: no-preference)")
|
|
942
|
+
];
|
|
943
|
+
const variantOrientations = [
|
|
944
|
+
utils.variantParentMatcher("landscape", "@media (orientation: landscape)"),
|
|
945
|
+
utils.variantParentMatcher("portrait", "@media (orientation: portrait)")
|
|
946
|
+
];
|
|
947
|
+
|
|
920
948
|
const variantSpaceAndDivide = (matcher) => {
|
|
921
949
|
if (/^space-?([xy])-?(-?.+)$/.test(matcher) || /^divide-/.test(matcher)) {
|
|
922
950
|
return {
|
|
@@ -932,16 +960,13 @@ const placeholderModifier = (input, { theme }) => {
|
|
|
932
960
|
const m = input.match(/^(.*)\b(placeholder-)(.+)$/);
|
|
933
961
|
if (m) {
|
|
934
962
|
const [, pre = "", p, body] = m;
|
|
935
|
-
if (
|
|
963
|
+
if (utils.hasParseableColor(body, theme) || hasOpacityValue(body)) {
|
|
936
964
|
return {
|
|
937
965
|
matcher: `${pre}placeholder-$ ${p}${body}`
|
|
938
966
|
};
|
|
939
967
|
}
|
|
940
968
|
}
|
|
941
969
|
};
|
|
942
|
-
function hasColorValue(body, theme) {
|
|
943
|
-
return !!utils.parseColor(body, theme)?.color;
|
|
944
|
-
}
|
|
945
970
|
function hasOpacityValue(body) {
|
|
946
971
|
const match = body.match(/^op(?:acity)?-?(.+)$/);
|
|
947
972
|
if (match && match[1] != null)
|
|
@@ -953,6 +978,8 @@ const variants = (options) => [
|
|
|
953
978
|
placeholderModifier,
|
|
954
979
|
variantSpaceAndDivide,
|
|
955
980
|
...variants$1.variants(options),
|
|
981
|
+
...variantOrientations,
|
|
982
|
+
...variantMotions,
|
|
956
983
|
...variantCombinators,
|
|
957
984
|
...variantColorsScheme
|
|
958
985
|
];
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { toArray, CONTROL_SHORTCUT_NO_MERGE } from '@unocss/core';
|
|
|
2
2
|
import { theme as theme$1 } from '@unocss/preset-mini/theme';
|
|
3
3
|
export { colors } from '@unocss/preset-mini';
|
|
4
4
|
import { varEmpty, cssVariables as cssVariables$1, cssProperty, pointerEvents, appearances, positions, insets, zIndexes, orders, grids, floats, margins, boxSizing, displays, aspectRatio, sizes, flex, transforms, cursors, userSelects, resizes, appearance, placements, alignments, justifies, gaps, overflows, textOverflows, whitespaces, breaks, borders, bgColors, svgUtilities, paddings, textAligns, textIndents, verticalAligns, fonts, fontStyles, textColors, textDecorations, fontSmoothings, tabSizes, textStrokes, textShadows, opacity, boxShadows, outline, rings, transitions, willChange, contents, questionMark } from '@unocss/preset-mini/rules';
|
|
5
|
-
import { handler, positionMap, parseColor, colorToString, colorResolver, colorableShadows, directionMap, directionSize, variantMatcher, variantParentMatcher } from '@unocss/preset-mini/utils';
|
|
5
|
+
import { handler, positionMap, parseColor, colorToString, colorResolver, colorableShadows, directionMap, directionSize, variantMatcher, variantParentMatcher, hasParseableColor } from '@unocss/preset-mini/utils';
|
|
6
6
|
import { variants as variants$1 } from '@unocss/preset-mini/variants';
|
|
7
7
|
|
|
8
8
|
const animations = [
|
|
@@ -899,6 +899,25 @@ const theme = {
|
|
|
899
899
|
"zoom-out-right": { "transform-origin": "right center" },
|
|
900
900
|
"zoom-out-up": { "transform-origin": "center bottom" }
|
|
901
901
|
}
|
|
902
|
+
},
|
|
903
|
+
media: {
|
|
904
|
+
portrait: "(orientation: portrait)",
|
|
905
|
+
landscape: "(orientation: landscape)",
|
|
906
|
+
os_dark: "(prefers-color-scheme: dark)",
|
|
907
|
+
os_light: "(prefers-color-scheme: light)",
|
|
908
|
+
motion_ok: "(prefers-reduced-motion: no-preference)",
|
|
909
|
+
motion_not_ok: "(prefers-reduced-motion: reduce)",
|
|
910
|
+
high_contrast: "(prefers-contrast: high)",
|
|
911
|
+
low_contrast: "(prefers-contrast: low)",
|
|
912
|
+
opacity_ok: "(prefers-reduced-transparency: no-preference)",
|
|
913
|
+
opacity_not_ok: "(prefers-reduced-transparency: reduce)",
|
|
914
|
+
useData_ok: "(prefers-reduced-data: no-preference)",
|
|
915
|
+
useData_not_ok: "(prefers-reduced-data: reduce)",
|
|
916
|
+
touch: "(hover: none) and (pointer: coarse)",
|
|
917
|
+
stylus: "(hover: none) and (pointer: fine)",
|
|
918
|
+
pointer: "(hover) and (pointer: coarse)",
|
|
919
|
+
mouse: "(hover) and (pointer: fine)",
|
|
920
|
+
hd_color: "(dynamic-range: high)"
|
|
902
921
|
}
|
|
903
922
|
};
|
|
904
923
|
|
|
@@ -913,6 +932,15 @@ const variantColorsScheme = [
|
|
|
913
932
|
variantParentMatcher("@light", "@media (prefers-color-scheme: light)")
|
|
914
933
|
];
|
|
915
934
|
|
|
935
|
+
const variantMotions = [
|
|
936
|
+
variantParentMatcher("motion-reduce", "@media (prefers-reduced-motion: reduce)"),
|
|
937
|
+
variantParentMatcher("motion-safe", "@media (prefers-reduced-motion: no-preference)")
|
|
938
|
+
];
|
|
939
|
+
const variantOrientations = [
|
|
940
|
+
variantParentMatcher("landscape", "@media (orientation: landscape)"),
|
|
941
|
+
variantParentMatcher("portrait", "@media (orientation: portrait)")
|
|
942
|
+
];
|
|
943
|
+
|
|
916
944
|
const variantSpaceAndDivide = (matcher) => {
|
|
917
945
|
if (/^space-?([xy])-?(-?.+)$/.test(matcher) || /^divide-/.test(matcher)) {
|
|
918
946
|
return {
|
|
@@ -928,16 +956,13 @@ const placeholderModifier = (input, { theme }) => {
|
|
|
928
956
|
const m = input.match(/^(.*)\b(placeholder-)(.+)$/);
|
|
929
957
|
if (m) {
|
|
930
958
|
const [, pre = "", p, body] = m;
|
|
931
|
-
if (
|
|
959
|
+
if (hasParseableColor(body, theme) || hasOpacityValue(body)) {
|
|
932
960
|
return {
|
|
933
961
|
matcher: `${pre}placeholder-$ ${p}${body}`
|
|
934
962
|
};
|
|
935
963
|
}
|
|
936
964
|
}
|
|
937
965
|
};
|
|
938
|
-
function hasColorValue(body, theme) {
|
|
939
|
-
return !!parseColor(body, theme)?.color;
|
|
940
|
-
}
|
|
941
966
|
function hasOpacityValue(body) {
|
|
942
967
|
const match = body.match(/^op(?:acity)?-?(.+)$/);
|
|
943
968
|
if (match && match[1] != null)
|
|
@@ -949,6 +974,8 @@ const variants = (options) => [
|
|
|
949
974
|
placeholderModifier,
|
|
950
975
|
variantSpaceAndDivide,
|
|
951
976
|
...variants$1(options),
|
|
977
|
+
...variantOrientations,
|
|
978
|
+
...variantMotions,
|
|
952
979
|
...variantCombinators,
|
|
953
980
|
...variantColorsScheme
|
|
954
981
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-wind",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.1",
|
|
4
4
|
"description": "Tailwind / Windi CSS compact preset for UnoCSS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unocss",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"*.css"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@unocss/core": "0.
|
|
39
|
-
"@unocss/preset-mini": "0.
|
|
38
|
+
"@unocss/core": "0.26.1",
|
|
39
|
+
"@unocss/preset-mini": "0.26.1"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "unbuild",
|