2
0
mirror of https://github.com/iconify/iconify.git synced 2024-11-17 01:55:09 +00:00

fix: require icons list for addCleanIconSelectors in Tailwind plugin

This commit is contained in:
Vjacheslav Trushkin 2023-02-07 21:34:26 +02:00
parent 2b0ca8f685
commit 8e6e5a3619

View File

@ -22,22 +22,11 @@ export function addDynamicIconSelectors(options?: DynamicIconifyPluginOptions) {
* Generate styles for preset list of icons * Generate styles for preset list of icons
*/ */
export function addCleanIconSelectors( export function addCleanIconSelectors(
icons?: string[] | string, icons: string[] | string,
options?: CleanIconifyPluginOptions options?: CleanIconifyPluginOptions
) { ) {
const passedOptions = const rules = getCSSRulesForIcons(icons, options);
typeof icons === 'object' && !(icons instanceof Array) return plugin(({ addUtilities }) => {
? 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 }) => {
addUtilities(rules); addUtilities(rules);
}); });
} }