@unocss/preset-wind 0.45.29 → 0.45.30
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/README.md +22 -0
- package/dist/index.cjs +13 -1
- package/dist/index.mjs +13 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -39,6 +39,28 @@ This preset uses `_` instead of `,` for respecting space in bracket syntax.
|
|
|
39
39
|
|
|
40
40
|
since some CSS rules require `,` as parts of the value, e.g. `grid-cols-[repeat(3,auto)]`
|
|
41
41
|
|
|
42
|
+
## Experimental Features
|
|
43
|
+
|
|
44
|
+
This preset includes experimental feature that may be changed in breaking ways at any time.
|
|
45
|
+
|
|
46
|
+
### Media Hover
|
|
47
|
+
|
|
48
|
+
Media hover addresses the [sticky hover](https://css-tricks.com/solving-sticky-hover-states-with-media-hover-hover/) problem where tapping target that includes hover style on mobile will persist that hover style until tapping elsewhere.
|
|
49
|
+
|
|
50
|
+
Since the regular `:hover` style most probably used so widely, the variant uses `@hover` syntax to distinguish it from the regular `hover` pseudo.
|
|
51
|
+
|
|
52
|
+
Example: `@hover-text-red`
|
|
53
|
+
|
|
54
|
+
Output:
|
|
55
|
+
```css
|
|
56
|
+
@media (hover: hover) and (pointer: fine) {
|
|
57
|
+
.\@hover-text-red:hover {
|
|
58
|
+
--un-text-opacity: 1;
|
|
59
|
+
color: rgba(248, 113, 113, var(--un-text-opacity));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
42
64
|
## License
|
|
43
65
|
|
|
44
66
|
MIT License © 2021-PRESENT [Anthony Fu](https://github.com/antfu)
|
package/dist/index.cjs
CHANGED
|
@@ -7,6 +7,7 @@ const utils = require('@unocss/preset-mini/utils');
|
|
|
7
7
|
const rules$1 = require('@unocss/preset-mini/rules');
|
|
8
8
|
const theme$1 = require('@unocss/preset-mini/theme');
|
|
9
9
|
const variants$1 = require('@unocss/preset-mini/variants');
|
|
10
|
+
const core = require('@unocss/core');
|
|
10
11
|
|
|
11
12
|
const animations = [
|
|
12
13
|
[/^(?:animate-)?keyframes-(.+)$/, ([, name], { theme }) => {
|
|
@@ -1077,6 +1078,16 @@ const variantColorsScheme = [
|
|
|
1077
1078
|
utils.variantParentMatcher("@light", "@media (prefers-color-scheme: light)")
|
|
1078
1079
|
];
|
|
1079
1080
|
|
|
1081
|
+
const variantStickyHover = [
|
|
1082
|
+
utils.variantMatcher("@hover", (input) => {
|
|
1083
|
+
core.warnOnce("The @hover variant is experimental and may not follow semver.");
|
|
1084
|
+
return {
|
|
1085
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (hover: hover) and (pointer: fine)`,
|
|
1086
|
+
selector: `${input.selector || ""}:hover`
|
|
1087
|
+
};
|
|
1088
|
+
})
|
|
1089
|
+
];
|
|
1090
|
+
|
|
1080
1091
|
const variantContrasts = [
|
|
1081
1092
|
utils.variantParentMatcher("contrast-more", "@media (prefers-contrast: more)"),
|
|
1082
1093
|
utils.variantParentMatcher("contrast-less", "@media (prefers-contrast: less)")
|
|
@@ -1127,7 +1138,8 @@ const variants = (options) => [
|
|
|
1127
1138
|
...variantOrientations,
|
|
1128
1139
|
...variantMotions,
|
|
1129
1140
|
...variantCombinators,
|
|
1130
|
-
...variantColorsScheme
|
|
1141
|
+
...variantColorsScheme,
|
|
1142
|
+
...variantStickyHover
|
|
1131
1143
|
];
|
|
1132
1144
|
|
|
1133
1145
|
const presetWind = (options = {}) => {
|
package/dist/index.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import { handler, globalKeywords, makeGlobalStaticRules, positionMap, parseColor
|
|
|
4
4
|
import { varEmpty, borderStyles, handlerBorderStyle, 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, textTransforms as textTransforms$1, fontStyles, textColors, textDecorations, fontSmoothings, tabSizes, textStrokes, textShadows, opacity, boxShadows, outline, rings, transitions, willChange, contentVisibility, contents, questionMark, transformBase, boxShadowsBase, ringBase } from '@unocss/preset-mini/rules';
|
|
5
5
|
import { theme as theme$1 } from '@unocss/preset-mini/theme';
|
|
6
6
|
import { variants as variants$1 } from '@unocss/preset-mini/variants';
|
|
7
|
+
import { warnOnce } from '@unocss/core';
|
|
7
8
|
|
|
8
9
|
const animations = [
|
|
9
10
|
[/^(?:animate-)?keyframes-(.+)$/, ([, name], { theme }) => {
|
|
@@ -1074,6 +1075,16 @@ const variantColorsScheme = [
|
|
|
1074
1075
|
variantParentMatcher("@light", "@media (prefers-color-scheme: light)")
|
|
1075
1076
|
];
|
|
1076
1077
|
|
|
1078
|
+
const variantStickyHover = [
|
|
1079
|
+
variantMatcher("@hover", (input) => {
|
|
1080
|
+
warnOnce("The @hover variant is experimental and may not follow semver.");
|
|
1081
|
+
return {
|
|
1082
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (hover: hover) and (pointer: fine)`,
|
|
1083
|
+
selector: `${input.selector || ""}:hover`
|
|
1084
|
+
};
|
|
1085
|
+
})
|
|
1086
|
+
];
|
|
1087
|
+
|
|
1077
1088
|
const variantContrasts = [
|
|
1078
1089
|
variantParentMatcher("contrast-more", "@media (prefers-contrast: more)"),
|
|
1079
1090
|
variantParentMatcher("contrast-less", "@media (prefers-contrast: less)")
|
|
@@ -1124,7 +1135,8 @@ const variants = (options) => [
|
|
|
1124
1135
|
...variantOrientations,
|
|
1125
1136
|
...variantMotions,
|
|
1126
1137
|
...variantCombinators,
|
|
1127
|
-
...variantColorsScheme
|
|
1138
|
+
...variantColorsScheme,
|
|
1139
|
+
...variantStickyHover
|
|
1128
1140
|
];
|
|
1129
1141
|
|
|
1130
1142
|
const presetWind = (options = {}) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-wind",
|
|
3
|
-
"version": "0.45.
|
|
3
|
+
"version": "0.45.30",
|
|
4
4
|
"description": "Tailwind / Windi CSS compact preset for UnoCSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"*.css"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@unocss/core": "0.45.
|
|
39
|
-
"@unocss/preset-mini": "0.45.
|
|
38
|
+
"@unocss/core": "0.45.30",
|
|
39
|
+
"@unocss/preset-mini": "0.45.30"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "unbuild",
|