Skip to content

Commit

Permalink
fix(svelte): fix custom icon classes
Browse files Browse the repository at this point in the history
fixes #4126
  • Loading branch information
nolimits4web committed Jan 31, 2023
1 parent 76e8e66 commit 06b406c
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/svelte/components/icon.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,26 @@
}
$: if (themeIcon) {
classes = {
icon: true,
};
const parts = themeIcon.split(':');
const prop = parts[0];
const value = parts[1];
if (prop === 'material' || prop === 'f7') {
classes['material-icons'] = prop === 'material';
classes['f7-icons'] = prop === 'f7';
}
if (prop === 'icon') {
classes[value] = true;
if (prop === 'icon') {
classes[value] = true;
}
} else {
if (themeIcon.includes(':')) {
themeIcon = themeIcon
.split(' ')
.map((el) => el.replace('icon:', ''))
.join(' ');
}
classes[themeIcon] = true;
}
} else {
classes = {
Expand Down

0 comments on commit 06b406c

Please sign in to comment.