Skip to content

Commit

Permalink
docs(preset-icon): complete options introduce (#3786)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
  • Loading branch information
zyyv and antfu committed May 10, 2024
1 parent 58e26bd commit 2fd5f51
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/components.d.ts
@@ -1,10 +1,10 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
export {}

/* prettier-ignore */
declare module 'vue' {
export interface GlobalComponents {
ContentExample: typeof import('./.vitepress/theme/components/ContentExample.vue')['default']
Expand Down
25 changes: 24 additions & 1 deletion docs/presets/icons.md
Expand Up @@ -482,7 +482,30 @@ Recommends:
- `https://esm.sh/`
- `https://cdn.skypack.dev/`

### Advanced Custom Icon Set Cleanup
### customFetch

- Type: `(url: string) => Promise<any>`
- Default: `undefined`

Preset used [`ofetch`](https://github.com/unjs/ofetch) as the default fetcher, you can also custom fetch function to provide the icon data.

### processor

- Type: `(cssObject: CSSObject, meta: Required<IconMeta>) => void`
- Default: `undefined`

```ts
interface IconMeta {
collection: string
icon: string
svg: string
mode?: IconsOptions['mode']
}
```

Processor for the CSS object before stringify. See [example](https://github.com/unocss/unocss/blob/7d83789b0dee8c72c401db24263ea429086de95d/test/preset-icons.test.ts#L66-L82).

## Advanced Custom Icon Set Cleanup

When using this preset with your custom icons, consider using a cleanup process similar to that done by [Iconify](https://iconify.design/) for any icons sets. All the tools you need are available in [Iconify Tools](https://iconify.design/docs/libraries/tools/).

Expand Down

0 comments on commit 2fd5f51

Please sign in to comment.