@unocss/preset-mini 0.35.2 → 0.36.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/README.md +64 -0
- package/dist/chunks/default.cjs +8 -1
- package/dist/chunks/default.mjs +8 -2
- package/dist/chunks/default2.cjs +86 -230
- package/dist/chunks/default2.mjs +12 -155
- package/dist/chunks/default3.cjs +34 -12
- package/dist/chunks/default3.mjs +34 -13
- package/dist/chunks/index.cjs +310 -0
- package/dist/chunks/index.mjs +300 -0
- package/dist/chunks/transform.cjs +129 -0
- package/dist/chunks/transform.mjs +126 -0
- package/dist/chunks/utilities.cjs +6 -297
- package/dist/chunks/utilities.mjs +3 -286
- package/dist/{colors-ce2fecb8.d.ts → colors-5590b862.d.ts} +1 -1
- package/dist/colors.d.ts +2 -2
- package/dist/{default-e6d1b2e8.d.ts → default-ee82f36d.d.ts} +1 -1
- package/dist/index.cjs +16 -2
- package/dist/index.d.ts +9 -7
- package/dist/index.mjs +16 -3
- package/dist/rules.cjs +5 -2
- package/dist/rules.d.ts +17 -2
- package/dist/rules.mjs +4 -2
- package/dist/theme.cjs +4 -0
- package/dist/theme.d.ts +21 -5
- package/dist/theme.mjs +4 -1
- package/dist/{types-f7b2c653.d.ts → types-0f7ef446.d.ts} +2 -0
- package/dist/{utilities-e7a7f845.d.ts → utilities-a77178bb.d.ts} +1 -1
- package/dist/utils.cjs +10 -8
- package/dist/utils.d.ts +9 -5
- package/dist/utils.mjs +2 -1
- package/dist/variants.cjs +3 -1
- package/dist/variants.d.ts +7 -6
- package/dist/variants.mjs +2 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -18,6 +18,70 @@ Unocss({
|
|
|
18
18
|
})
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
## Features
|
|
22
|
+
|
|
23
|
+
### Dark Mode
|
|
24
|
+
|
|
25
|
+
By default, this preset generates class based dark mode with `dark:` variant.
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<div class="dark:bg-red:10" />
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
will generate:
|
|
32
|
+
|
|
33
|
+
```css
|
|
34
|
+
.dark .dark\:bg-red\:10 {
|
|
35
|
+
background-color: rgba(248, 113, 113, 0.1);
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
To opt-in media query based dark mode, you can use `@dark:` variant:
|
|
40
|
+
|
|
41
|
+
```html
|
|
42
|
+
<div class="@dark:bg-red:10" />
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
```css
|
|
46
|
+
@media (prefers-color-scheme: dark) {
|
|
47
|
+
.\@dark\:bg-red\:10 {
|
|
48
|
+
background-color: rgba(248, 113, 113, 0.1);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Or set globally with the config for `dark:` variant
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
presetMini({
|
|
57
|
+
dark: 'media'
|
|
58
|
+
})
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### CSS @layer
|
|
62
|
+
|
|
63
|
+
[CSS's native @layer](https://developer.mozilla.org/en-US/docs/Web/CSS/@layer) is supported with variant `layer-xx:`
|
|
64
|
+
|
|
65
|
+
```html
|
|
66
|
+
<div class="layer-foo:p4" />
|
|
67
|
+
<div class="layer-bar:m4" />
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
will generate:
|
|
71
|
+
|
|
72
|
+
```css
|
|
73
|
+
@layer foo {
|
|
74
|
+
.layer-foo\:p4 {
|
|
75
|
+
padding: 1rem;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
@layer bar {
|
|
79
|
+
.layer-bar\:m4 {
|
|
80
|
+
margin: 1rem;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
21
85
|
## License
|
|
22
86
|
|
|
23
87
|
MIT License © 2021-PRESENT [Anthony Fu](https://github.com/antfu)
|
package/dist/chunks/default.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const colors = require('./colors.cjs');
|
|
4
|
+
const transform = require('./transform.cjs');
|
|
4
5
|
|
|
5
6
|
const fontFamily = {
|
|
6
7
|
sans: [
|
|
@@ -224,6 +225,10 @@ const maxHeight = {
|
|
|
224
225
|
screen: "100vh"
|
|
225
226
|
};
|
|
226
227
|
|
|
228
|
+
const preflightBase = {
|
|
229
|
+
...transform.transformBase
|
|
230
|
+
};
|
|
231
|
+
|
|
227
232
|
const theme = {
|
|
228
233
|
width,
|
|
229
234
|
height,
|
|
@@ -256,7 +261,8 @@ const theme = {
|
|
|
256
261
|
lineWidth,
|
|
257
262
|
spacing,
|
|
258
263
|
duration,
|
|
259
|
-
ringWidth
|
|
264
|
+
ringWidth,
|
|
265
|
+
preflightBase
|
|
260
266
|
};
|
|
261
267
|
|
|
262
268
|
exports.baseSize = baseSize;
|
|
@@ -275,6 +281,7 @@ exports.lineHeight = lineHeight;
|
|
|
275
281
|
exports.lineWidth = lineWidth;
|
|
276
282
|
exports.maxHeight = maxHeight;
|
|
277
283
|
exports.maxWidth = maxWidth;
|
|
284
|
+
exports.preflightBase = preflightBase;
|
|
278
285
|
exports.ringWidth = ringWidth;
|
|
279
286
|
exports.spacing = spacing;
|
|
280
287
|
exports.textIndent = textIndent;
|
package/dist/chunks/default.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { c as colors } from './colors.mjs';
|
|
2
|
+
import { t as transformBase } from './transform.mjs';
|
|
2
3
|
|
|
3
4
|
const fontFamily = {
|
|
4
5
|
sans: [
|
|
@@ -222,6 +223,10 @@ const maxHeight = {
|
|
|
222
223
|
screen: "100vh"
|
|
223
224
|
};
|
|
224
225
|
|
|
226
|
+
const preflightBase = {
|
|
227
|
+
...transformBase
|
|
228
|
+
};
|
|
229
|
+
|
|
225
230
|
const theme = {
|
|
226
231
|
width,
|
|
227
232
|
height,
|
|
@@ -254,7 +259,8 @@ const theme = {
|
|
|
254
259
|
lineWidth,
|
|
255
260
|
spacing,
|
|
256
261
|
duration,
|
|
257
|
-
ringWidth
|
|
262
|
+
ringWidth,
|
|
263
|
+
preflightBase
|
|
258
264
|
};
|
|
259
265
|
|
|
260
|
-
export { fontSize as a, blur as b, textIndent as c, dropShadow as d, textStrokeWidth as e, fontFamily as f, textShadow as g, letterSpacing as h, breakpoints as i, lineWidth as j, duration as k, lineHeight as l, borderRadius as m, boxShadow as n, easing as o, baseSize as p, width as q, ringWidth as r, spacing as s, theme as t, maxWidth as u, verticalBreakpoints as v, wordSpacing as w, height as x, maxHeight as y };
|
|
266
|
+
export { fontSize as a, blur as b, textIndent as c, dropShadow as d, textStrokeWidth as e, fontFamily as f, textShadow as g, letterSpacing as h, breakpoints as i, lineWidth as j, duration as k, lineHeight as l, borderRadius as m, boxShadow as n, easing as o, baseSize as p, width as q, ringWidth as r, spacing as s, theme as t, maxWidth as u, verticalBreakpoints as v, wordSpacing as w, height as x, maxHeight as y, preflightBase as z };
|