ngneat / svg-icon

👻 A lightweight library that makes it easier to use SVG icons in your Angular Application
https://netbasal.com
MIT License
257 stars 35 forks source link

Fixed icon sizes ignored after Angular v13 minor upgrade #85

Closed RonnieRocket147 closed 2 years ago

RonnieRocket147 commented 2 years ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

After upgrading Angular from v13.2.3 to v13.3.2 all the svg-icon have a size of 1em. The fixed sizes are ignored now:

        SvgIconsModule.forRoot({
            defaultSize: 'md',
            icons,
            missingIconFallback: appInfo,
            sizes: {
                //'xs': '8px',
                'sm': '16px',
                'md': '20px',
                'lg': '24px',
                'xl': '32px',
                'xxl': '48px',
            }
        })

Expected behavior

The fixed icon sizes should not be overriden by another style.

Environment


Angular version: 13.3.2
@ngneat/svg-icon: 4.1.0


Browser:
- [X] Chrome (desktop) version 100

For Tooling issues:
- Node version: 16.13.0
- Platform:  Mac
Screenshot 2022-04-10 at 13 39 04
RonnieRocket147 commented 2 years ago

Any help/pointers would be appreciated, still struggling to get this fixed. Thanks

shaharkazaz commented 2 years ago

@RonnieRocket147 I'm on v13.3.3 and it seems to be working fine. can you try updating? if the issue still persists please share a reproduction.

RonnieRocket147 commented 2 years ago

Thank you @shaharkazaz

I finally found the cause of my issue. It appears mixing fontSize and size causes strange results. So I decided to stick with using size only.

shaharkazaz commented 2 years ago

@RonnieRocket147 size is used to refer to the predefined sizes, fontSize is used to set a custom size and overide the size. Once fontSize is set, it will be used.

RonnieRocket147 commented 2 years ago

Yes indeed. However I need more than 6 predefined sizes. It would be great if the library would allow for more predefined sizes.

shaharkazaz commented 2 years ago

@RonnieRocket147 This was actually just a type issue, we don't have any limitation on how many sizes you can define. Should be fixed in v4.1.2