2
0
mirror of https://github.com/iconify/iconify.git synced 2025-01-08 07:48:29 +00:00

chore(tailwind): make prefixes list optional

This commit is contained in:
Vjacheslav Trushkin 2024-05-10 19:52:48 +03:00
parent dde22dea42
commit a000307d6f
3 changed files with 3 additions and 4 deletions

View File

@ -89,8 +89,7 @@ module.exports = {
maskSelector: '.iconify-nosize', maskSelector: '.iconify-nosize',
backgroundSelector: '', backgroundSelector: '',
scale: 0, scale: 0,
// Empty prefixes list: reusing data from plugin above // No prefixes list: reusing data from plugin above
prefixes: [],
}), }),
// Plugin with clean selectors: requires writing all used icons in first parameter // Plugin with clean selectors: requires writing all used icons in first parameter
addCleanIconSelectors(['mdi-light:home']), addCleanIconSelectors(['mdi-light:home']),

View File

@ -95,7 +95,7 @@ export interface IconifyPluginOptionsObject {
scale?: number; scale?: number;
// Prefixes to load // Prefixes to load
prefixes: IconifyPluginListOptions; prefixes?: IconifyPluginListOptions;
// Customise callback // Customise callback
customise?: (content: string, name: string, prefix: string) => string; customise?: (content: string, name: string, prefix: string) => string;

View File

@ -73,7 +73,7 @@ export function getCSSRulesForPlugin(options: IconifyPluginOptions) {
// Add icon sets // Add icon sets
const iconSelector = fullOptions.iconSelector || '.{prefix}--{name}'; const iconSelector = fullOptions.iconSelector || '.{prefix}--{name}';
fullOptions.prefixes.forEach((item) => { fullOptions.prefixes?.forEach((item) => {
let prefix: string; let prefix: string;
let iconSet: IconifyJSON | undefined; let iconSet: IconifyJSON | undefined;
let iconsList: IconsListOption | undefined; let iconsList: IconsListOption | undefined;