2
0
mirror of https://github.com/iconify/iconify.git synced 2024-09-28 04:59:07 +00:00

chore: update tailwind plugin

This commit is contained in:
Vjacheslav Trushkin 2024-04-28 19:12:49 +03:00
parent 7f09fc25ff
commit 721c6ae9b7
2 changed files with 9 additions and 2 deletions

View File

@ -2,7 +2,7 @@
"name": "@iconify/tailwind",
"description": "Iconify plugin for Tailwind CSS",
"author": "Vjacheslav Trushkin <cyberalien@gmail.com> (https://iconify.design)",
"version": "0.1.4",
"version": "1.0.0",
"license": "MIT",
"main": "./dist/plugin.js",
"types": "./dist/plugin.d.ts",

View File

@ -13,7 +13,14 @@ export function addDynamicIconSelectors(options?: DynamicIconifyPluginOptions) {
const prefix = options?.prefix || 'icon';
return plugin(({ matchComponents }) => {
matchComponents({
[prefix]: (icon: string) => getDynamicCSSRules(icon, options),
[prefix]: (icon: string) => {
try {
return getDynamicCSSRules(icon, options);
} catch (err) {
// Log error, but do not throw it
console.error(err.message);
}
},
});
});
}