Skip to content

[CSidebarNavItem] Icon props are not passed to CIcon #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
CVeniamin opened this issue Apr 2, 2020 · 2 comments
Closed

[CSidebarNavItem] Icon props are not passed to CIcon #76

CVeniamin opened this issue Apr 2, 2020 · 2 comments

Comments

@CVeniamin
Copy link

CVeniamin commented Apr 2, 2020

I am trying to adjust the size of icon in the CSidebarNavItem by passing icon as an object, such as

<CSidebarNavItem 
  name="Dashboard" 
   to="/dashboard" 
   :icon="{name: 'cil-chart', size: '4xl'}"
/>

however the size prop is not passed to CIcon.
However, creating a CIcon with the size prop works just fine

<CIcon name="cil-chart" size="4xl"/>

After searching through the code I saw that CIconRaw is imported instead of CIcon

import CIcon from '@coreui/icons-vue/src/CIconRaw.vue'

Could it be that importing CIconRaw instead of CIcon is to blame here?

@woothu
Copy link

woothu commented Apr 2, 2020

Hi, thank you for the report!

in fact, it doesn't work because 'customClasses' is set to 'c-sidebar-nav-icon' inside CSidebarNavItem overriding size prop in CIcon.

Hotfix:

<CSidebarNavItem 
  name="Dashboard" 
   to="/dashboard" 
   :icon="{name: 'cil-chart', customClasses: 'c-sidebar-nav-icon c-icon c-icon-4xl'}"
/>

We will think of a better solution, and fixing documentation of CIcon (it doesn't say that using customClasses overrides size prop).

@woothu woothu closed this as completed Apr 2, 2020
@CVeniamin
Copy link
Author

@woothu, thank you for the hotfix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants