@unocss/preset-icons 0.27.6 → 0.28.2
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 +3 -3
- package/package.json +13 -12
package/README.md
CHANGED
|
@@ -41,9 +41,9 @@ import presetIcons from '@unocss/preset-icons'
|
|
|
41
41
|
|
|
42
42
|
Unocss({
|
|
43
43
|
presets: [
|
|
44
|
-
presetIcons({ /* options */ })
|
|
44
|
+
presetIcons({ /* options */ }),
|
|
45
45
|
// ...other presets
|
|
46
|
-
]
|
|
46
|
+
],
|
|
47
47
|
})
|
|
48
48
|
```
|
|
49
49
|
|
|
@@ -69,7 +69,7 @@ presetIcons({
|
|
|
69
69
|
'display': 'inline-block',
|
|
70
70
|
'vertical-align': 'middle',
|
|
71
71
|
// ...
|
|
72
|
-
}
|
|
72
|
+
},
|
|
73
73
|
})
|
|
74
74
|
```
|
|
75
75
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-icons",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.2",
|
|
4
4
|
"description": "Pure CSS Icons for UnoCSS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unocss",
|
|
@@ -14,18 +14,16 @@
|
|
|
14
14
|
"url": "https://github.com/unocss/unocss/issues"
|
|
15
15
|
},
|
|
16
16
|
"license": "MIT",
|
|
17
|
+
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
17
18
|
"repository": {
|
|
18
19
|
"type": "git",
|
|
19
20
|
"url": "git+https://github.com/unocss/unocss.git",
|
|
20
21
|
"directory": "packages/preset-icons"
|
|
21
22
|
},
|
|
22
23
|
"funding": "https://github.com/sponsors/antfu",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"dist",
|
|
27
|
-
"*.css"
|
|
28
|
-
],
|
|
24
|
+
"main": "dist/index.cjs",
|
|
25
|
+
"module": "dist/index.mjs",
|
|
26
|
+
"types": "dist/index.d.ts",
|
|
29
27
|
"exports": {
|
|
30
28
|
".": {
|
|
31
29
|
"require": "./dist/index.cjs",
|
|
@@ -38,12 +36,14 @@
|
|
|
38
36
|
"types": "./dist/fs.d.ts"
|
|
39
37
|
}
|
|
40
38
|
},
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
"files": [
|
|
40
|
+
"dist",
|
|
41
|
+
"*.css"
|
|
42
|
+
],
|
|
43
|
+
"sideEffects": false,
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@iconify/utils": "^1.0.23",
|
|
46
|
-
"@unocss/core": "0.
|
|
46
|
+
"@unocss/core": "0.28.2",
|
|
47
47
|
"local-pkg": "^0.4.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
@@ -52,5 +52,6 @@
|
|
|
52
52
|
"scripts": {
|
|
53
53
|
"build": "unbuild",
|
|
54
54
|
"stub": "unbuild --stub"
|
|
55
|
-
}
|
|
55
|
+
},
|
|
56
|
+
"readme": "# @unocss/preset-icons\n\nUse **any** icons with **Pure CSS** for [UnoCSS](https://github.com/unocss/unocss).\n\n<blockquote>\n<p>💡 Recommend reading - <br><a href=\"https://antfu.me/posts/icons-in-pure-css\"><strong>Icons in Pure CSS</strong></a><br></p>\n</blockquote>\n\nFollow the following conventions to use the icons\n\n- `<prefix><collection>-<icon>`\n- `<prefix><collection>:<icon>`\n\nFor examples:\n\n```html\n<!-- A basic anchor icon from Phosphor icons -->\n<div class=\"i-ph-anchor-simple-thin\" />\n<!-- An orange alarm from Material Design Icons -->\n<div class=\"i-mdi-alarm text-orange-400\" />\n<!-- A large Vue logo -->\n<div class=\"i-logos-vue text-3xl\" />\n<!-- Sun in light mode, Moon in dark mode, from Carbon -->\n<button class=\"i-carbon-sun dark:i-carbon-moon\" />\n<!-- Twemoji of laugh, turns to tear on hovering -->\n<div class=\"i-twemoji-grinning-face-with-smiling-eyes hover:i-twemoji-face-with-tears-of-joy\" />\n```\n\n<img src=\"https://user-images.githubusercontent.com/11247099/136709053-31b4db79-eddc-4dc6-aa2d-388086332630.gif\" height=\"100\"><br><sup>This is powered by pure CSS</sup>\n\n## Install\n\n```bash\nnpm i -D @unocss/preset-icons @iconify-json/[the-collection-you-want]\n```\n\nWe use [Iconify](https://iconify.design) as our data source of icons. You need to install the corresponding iconset in `devDependencies` by following the `@iconify-json/*` pattern. For example, `@iconify-json/mdi` for [Material Design Icons](https://materialdesignicons.com/), `@iconify-json/tabler` for [Tabler](https://tabler-icons.io/). You can refer to [Icônes](https://icones.js.org/) or [Iconify](https://icon-sets.iconify.design/) for all the collections available.\n\n```ts\nimport presetIcons from '@unocss/preset-icons'\n\nUnocss({\n presets: [\n presetIcons({ /* options */ }),\n // ...other presets\n ],\n})\n```\n\n> 💡 You can also use this preset alone as a complement to your existing UI frameworks to have pure CSS icons!\n\nIf you prefer to install the all the icon sets available on Iconify at once (~130MB):\n\n```bash\nnpm i -D @iconify/json\n```\n\n## Configuration\n\nRefer to the [type definition](https://github.com/unocss/unocss/blob/main/packages/preset-icons/src/types.ts#L4) for all configurations avaliable.\n\n### Extra Properties\n\nYou can provide the extra CSS properties to control the default behavior of the icons. The following is an example of make icons inlined by default:\n\n```ts\npresetIcons({\n extraProperties: {\n 'display': 'inline-block',\n 'vertical-align': 'middle',\n // ...\n },\n})\n```\n\n## Modes Overriding\n\nBy default, this preset will choose the rendering modes automatically for each icon based on the icons' characteristics. You can read more in this [blog post](https://antfu.me/posts/icons-in-pure-css). In some cases, you may want to explicitly set the rendering modes for each icon.\n\n- `?bg` for `background-img` - renders the icon as a background image\n- `?mask` for `mask` - renders the icon as a mask image\n\nfor example, `vscode-icons:file-type-light-db`, an icon with colors that will be rendered as a background image. Use `vscode-icons:file-type-light-db?bg` to render it as a mask image and bypass it's colors.\n\n## Credits\n\nThis preset is inspired from [this issue](https://github.com/antfu/unplugin-icons/issues/88) created by [@husayt](https://github.com/husayt). Based on the work of [this PR](https://github.com/antfu/unplugin-icons/pull/90) by [@userquin](https://github.com/userquin).\n\n## License\n\nMIT License © 2021-PRESENT [Anthony Fu](https://github.com/antfu)\n"
|
|
56
57
|
}
|