File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
core/src/components/badge Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -94,21 +94,23 @@ export class Badge implements ComponentInterface {
9494 }
9595
9696 // The 'subtle' hue is the default for badges containing text or icons
97- // The 'bold' hue is used when inside of a button, tab button, or when
98- // the badge is empty (no text or icon)
97+ // The 'bold' hue is used when inside of an avatar, button, tab button,
98+ // or when the badge is empty (no text or icon)
9999 private getHue ( ) : string | undefined {
100100 const { hue } = this ;
101101
102102 if ( hue !== undefined ) {
103103 return hue ;
104104 }
105105
106+ const inAvatar = hostContext ( 'ion-avatar' , this . el ) ;
106107 const inButton = hostContext ( 'ion-button' , this . el ) ;
107108 const inTabButton = hostContext ( 'ion-tab-button' , this . el ) ;
108109 const hasContent = this . el . textContent ?. trim ( ) !== '' || this . el . querySelector ( 'ion-icon' ) !== null ;
109110
110- // Return 'bold' if the badge is inside a button, tab button, or has no content
111- if ( inButton || inTabButton || ! hasContent ) {
111+ // Return 'bold' if the badge is inside an avatar, button, tab button,
112+ // or has no content
113+ if ( inAvatar || inButton || inTabButton || ! hasContent ) {
112114 return 'bold' ;
113115 }
114116
You can’t perform that action at this time.
0 commit comments