tailwindcss-plugin-icons
Advanced tools
Comparing version 2.0.8 to 2.1.0
@@ -16,2 +16,3 @@ import * as tailwindcss_types_config from 'tailwindcss/types/config' | ||
} | ||
type ScaleFactory = (iconName: string) => number | ||
type IconSetOptions = { | ||
@@ -26,6 +27,5 @@ /** | ||
*/ | ||
scale?: number | ||
scale?: number | ScaleFactory | ||
/** | ||
* The location of the icon source in Iconify JSON format. Can be any URI, local path, or module name. | ||
* @link https://docs.iconify.design/types/iconify-json.html | ||
* @default "@iconify/json" or "@iconify-json/[name]" | ||
@@ -43,2 +43,9 @@ */ | ||
export { IconSetOptions, IconSetOptionsRecord, Icons, Options, SCALE } | ||
export { | ||
IconSetOptions, | ||
IconSetOptionsRecord, | ||
Icons, | ||
Options, | ||
SCALE, | ||
ScaleFactory | ||
} |
{ | ||
"name": "tailwindcss-plugin-icons", | ||
"version": "2.0.8", | ||
"version": "2.1.0", | ||
"description": "Tailwind CSS icons with classes", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
# tailwindcss-plugin-icons | ||
[![npm](https://badgen.net/npm/v/tailwindcss-plugin-icons)](https://www.npmjs.com/package/tailwindcss-plugin-icons) | ||
[![LICENSE](https://badgen.net/github/license/micromatch/micromatch?color=green)](https://github.com/JensDll/tailwindcss-plugin-icons/blob/main/LICENSE) | ||
[![npm](https://img.shields.io/npm/v/tailwindcss-plugin-icons)](https://www.npmjs.com/package/tailwindcss-plugin-icons) | ||
[![example](https://img.shields.io/badge/exmaple-StackBlitz-green)](https://stackblitz.com/github/JensDll/tailwindcss-plugin-icons/tree/main/playground/vue?file=tailwind.config.cjs) | ||
[![license](https://img.shields.io/npm/l/tailwindcss-plugin-icons?color=lightgrey)](https://github.com/JensDll/tailwindcss-plugin-icons/blob/main/LICENSE) | ||
[Tailwind CSS](https://tailwindcss.com/docs/installation) port of [@unocss/preset-icons](https://github.com/unocss/unocss/tree/main/packages/preset-icons/). | ||
[Tailwind CSS](https://tailwindcss.com/docs/installation) implementation of [@unocss/preset-icons](https://github.com/unocss/unocss/tree/main/packages/preset-icons/). | ||
```bash | ||
# Npm | ||
npm install tailwindcss-plugin-icons | ||
# Pnpm | ||
``` | ||
```bash | ||
pnpm add tailwindcss-plugin-icons | ||
# Yarn | ||
``` | ||
```bash | ||
yarn add tailwindcss-plugin-icons | ||
@@ -20,3 +24,3 @@ ``` | ||
1. Search the available icon sets at [Icônes](https://icones.js.org/collection/all?s=) or [Iconify](https://icon-sets.iconify.design/) and choose the icons your project needs. | ||
2. Install the icon sets with `npm install @iconify-json/[the-collection-you-want]`. | ||
2. Install any required icon set with `npm install @iconify-json/[the-icon-set-name]`. | ||
3. Configure the plugin in your `tailwind.config` file, for example, [heroicons](https://heroicons.com/): | ||
@@ -56,7 +60,10 @@ | ||
The plugin's `options` is a function. It gets forwarded the [Tailwind CSS plugin API](https://tailwindcss.com/docs/plugins) and returns the selected icons with optional default style and scale. After the icon's name, you can pass `?bg` or `?mask` to force a specific render method (see also the [comprehensive example](https://stackblitz.com/github/JensDll/tailwindcss-plugin-icons/tree/main/playground/vue?file=tailwind.config.cjs)). | ||
The plugin's `options` are a function. It gets forwarded the [Tailwind CSS plugin API](https://tailwindcss.com/docs/plugins) and returns the selected icons with optional default style and scale. After the icon's name, you can pass `?bg` or `?mask` to force a specific render method. Finally, you can use `includeAll: true` to have every icon in the icon set added as a Tailwind source. | ||
<!-- markdownlint-disable-next-line ol-prefix --> | ||
4. Write icons with [Tailwind CSS](https://tailwindcss.com/docs/installation) classes directly in your markup: | ||
<!-- markdownlint-disable ol-prefix --> | ||
4. Write icons with Tailwind CSS classes directly in your markup: | ||
<!-- markdownlint-enable ol-prefix --> | ||
```html | ||
@@ -67,2 +74,2 @@ <div class="i-heroicons-plus-circle"></div> | ||
## [Example](https://stackblitz.com/github/JensDll/tailwindcss-plugin-icons/tree/main/playground/vue?file=tailwind.config.cjs) | ||
## [Comprehensive Example](https://stackblitz.com/github/JensDll/tailwindcss-plugin-icons/tree/main/playground/vue?file=tailwind.config.cjs) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
38530
910
73