From 8e6e5a3619a570bc42dca0289cb48d0e0632bd3c Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Tue, 7 Feb 2023 21:34:26 +0200 Subject: [PATCH] fix: require icons list for addCleanIconSelectors in Tailwind plugin --- plugins/tailwind/src/plugin.ts | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/plugins/tailwind/src/plugin.ts b/plugins/tailwind/src/plugin.ts index afb8d1e..ec412bd 100644 --- a/plugins/tailwind/src/plugin.ts +++ b/plugins/tailwind/src/plugin.ts @@ -22,22 +22,11 @@ export function addDynamicIconSelectors(options?: DynamicIconifyPluginOptions) { * Generate styles for preset list of icons */ export function addCleanIconSelectors( - icons?: string[] | string, + icons: string[] | string, options?: CleanIconifyPluginOptions ) { - const passedOptions = - typeof icons === 'object' && !(icons instanceof Array) - ? icons - : options || {}; - const passedIcons = - typeof icons !== 'object' || icons instanceof Array ? icons : void 0; - - // Get hardcoded list of icons - const rules = passedIcons - ? getCSSRulesForIcons(passedIcons, passedOptions) - : void 0; - - return plugin(({ addUtilities, matchComponents }) => { + const rules = getCSSRulesForIcons(icons, options); + return plugin(({ addUtilities }) => { addUtilities(rules); }); }