@iconify/tailwind
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -68,5 +68,15 @@ import { Config } from 'tailwindcss/types/config'; | ||
export declare interface IconifyPluginOptions extends IconCSSIconSetOptions { | ||
/** | ||
* Options for locating icon sets | ||
*/ | ||
declare interface IconifyPluginFileOptions { | ||
files?: Record<string, string>; | ||
} | ||
/** | ||
* All options | ||
*/ | ||
export declare interface IconifyPluginOptions extends IconCSSIconSetOptions, IconifyPluginFileOptions { | ||
} | ||
export { } |
@@ -10,3 +10,3 @@ /** | ||
* @license MIT | ||
* @version 0.0.1 | ||
* @version 0.0.2 | ||
*/ | ||
@@ -318,3 +318,6 @@ 'use strict'; | ||
*/ | ||
function locateIconSet(prefix) { | ||
function locateIconSet(prefix, options) { | ||
if (options.files?.[prefix]) { | ||
return options.files?.[prefix]; | ||
} | ||
try { | ||
@@ -332,4 +335,4 @@ return require.resolve(`@iconify-json/${prefix}/icons.json`); | ||
*/ | ||
function loadIconSet(prefix) { | ||
const filename = locateIconSet(prefix); | ||
function loadIconSet(prefix, options) { | ||
const filename = locateIconSet(prefix, options); | ||
if (filename) { | ||
@@ -414,3 +417,3 @@ try { | ||
for (const prefix in prefixes) { | ||
const iconSet = loadIconSet(prefix); | ||
const iconSet = loadIconSet(prefix, options); | ||
if (!iconSet) { | ||
@@ -437,4 +440,4 @@ throw new Error(`Cannot load icon set for "${prefix}"`); | ||
function iconifyPlugin(icons, options = {}) { | ||
const rules = getCSSRules(icons, options); | ||
return plugin(({ addUtilities }) => { | ||
const rules = getCSSRules(icons, options); | ||
addUtilities(rules); | ||
@@ -441,0 +444,0 @@ }); |
@@ -5,3 +5,3 @@ { | ||
"author": "Vjacheslav Trushkin <cyberalien@gmail.com> (https://iconify.design)", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"license": "MIT", | ||
@@ -8,0 +8,0 @@ "main": "./dist/plugin.js", |
@@ -16,4 +16,4 @@ # Iconify for Tailwind CSS | ||
- Class name for icon set. | ||
- Class name for icon. | ||
- Class name for icon set: `icon--{prefix}`. | ||
- Class name for icon: `icon--{prefix}--{name}`. | ||
@@ -24,3 +24,3 @@ ```html | ||
Why 2 class names? It reduces duplication and makes it easy to change all icons from one icon set. | ||
Why 2 class names? It reduces duplication and makes it easy to target all icons from one icon set. | ||
@@ -31,2 +31,4 @@ You can change that with options: you can change class names format, you can disable common selector. See [options for function used by plugin](https://docs.iconify.design/tools/utils/get-icons-css.html). | ||
Monoton icons can change color! See [Iconify documentation](https://docs.iconify.design/icon-components/css.html#mask) for longer explanation. | ||
To change icon size or color, change font size or text color, like you would with any text. | ||
@@ -56,4 +58,2 @@ | ||
Then you need to add and configure plugin. | ||
Add this to `tailwind.config.js`: | ||
@@ -60,0 +60,0 @@ |
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
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
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
4
0
20580
6
536