@unocss/preset-mini 0.43.0 → 0.43.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.
Files changed (2) hide show
  1. package/README.md +48 -0
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -82,6 +82,54 @@ will generate:
82
82
  }
83
83
  ```
84
84
 
85
+ ### Theme
86
+ You can fully customize your theme property in your config, and UnoCSS will eventually deeply merge it to the default theme.
87
+
88
+ <!--eslint-skip-->
89
+
90
+ ```ts
91
+ presetMini({
92
+ theme: {
93
+ // ...
94
+ colors: {
95
+ 'veryCool': '#0000ff', // class="text-very-cool"
96
+ 'brand': {
97
+ 'primary': 'hsla(var(--hue, 217), 78%, 51%)', //class="bg-brand-primary"
98
+ }
99
+ },
100
+ }
101
+ })
102
+ ```
103
+
104
+ To consume the theme in rules:
105
+
106
+ ```ts
107
+ rules: [
108
+ [/^text-(.*)$/, ([, c], { theme }) => {
109
+ if (theme.colors[c])
110
+ return { color: theme.colors[c] }
111
+ }],
112
+ ]
113
+ ```
114
+
115
+ One exception is that UnoCSS gives full control of `breakpoints` to users. When a custom `breakpoints` is provided, the default will be overridden instead of merging. For example:
116
+
117
+ ```ts
118
+ presetMini({
119
+ theme: {
120
+ // ...
121
+ breakpoints: {
122
+ sm: '320px',
123
+ md: '640px',
124
+ },
125
+ },
126
+ })
127
+ ```
128
+
129
+ Right now, you can only use the `sm:` and `md:` breakpoint variants.
130
+
131
+ `verticalBreakpoints` is same as `breakpoints` but for vertical layout.
132
+
85
133
  ## License
86
134
 
87
135
  MIT License &copy; 2021-PRESENT [Anthony Fu](https://github.com/antfu)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-mini",
3
- "version": "0.43.0",
3
+ "version": "0.43.1",
4
4
  "description": "The minimal preset for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -61,7 +61,7 @@
61
61
  "*.css"
62
62
  ],
63
63
  "dependencies": {
64
- "@unocss/core": "0.43.0"
64
+ "@unocss/core": "0.43.1"
65
65
  },
66
66
  "scripts": {
67
67
  "build": "unbuild",