Closed secundant closed 1 year ago
svg({ resetColors: [ { include: /^flags/, replace: { from: 'white', to: 'currentColor' } }, { keep: myTheme.brandColors, exclude: [/^flags/, /^logos/, /-colored\.svg$/, 'my-icon.svg'], replace: [ { from: myTheme.accentIconColors, to: 'var(--icon-color)' }, { from: myTheme.secondaryIconColors, to: 'var(--icon-bg)' } ], replaceUnknwon: 'currentColor' } ] });
I've got some missed features from the real users:
resetColors: false
svg({ resetColors: false })
svg({ resetColors: { exclude: ['logos/colored', /^flags/] } })
svg({ resetColors: { keep: ['#fff', 'red'] } })
svg({ resetColors: { replace: { from: ['#222', '#eee'], to: 'var(--icon-color)' }, keep: ['#a1a1a1', '#f9c52'], exclude: [/flags/], replaceUnknown: 'currentColor' } });
API Design
Motivation
I've got some missed features from the real users:
resetColors: false
First versions of API
Disable
Filter icons
Filter colors
Complex solution