@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 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 &copy; 2021-PRESENT [Anthony Fu](https://github.com/antfu)
@@ -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;
@@ -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 };