Skip to content

Commit

Permalink
fix: 🐛 sizes should be merged
Browse files Browse the repository at this point in the history
  • Loading branch information
NetanelBasal committed Dec 27, 2022
1 parent 0295b4f commit 15926d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions projects/ngneat/svg-icon/src/lib/svg-icon.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,18 @@ export class SvgIconComponent {
},
};

const merged = {
const mergedConfig = {
...defaults,
...this.config,
};

merged.sizes = Object.entries(merged.sizes).reduce((acc, [key, value]) => {
mergedConfig.sizes = Object.entries({ ...defaults.sizes, ...mergedConfig.sizes }).reduce((acc, [key, value]) => {
acc[key] = `var(--svg-icon-font-size-${key}, ${value})`;

return acc;
}, {} as SVG_CONFIG['sizes']);

return merged;
return mergedConfig;
}

private setIconSize(size: string) {
Expand Down

0 comments on commit 15926d2

Please sign in to comment.