File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
packages/components/bolt-icon/src Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -65,13 +65,15 @@ export class BoltIcon extends withPreact(withComponent()) {
65
65
* The container with the class change contains this particular icon element so
66
66
* we should double-check the color contrast values.
67
67
*/
68
- if ( data . target . contains ( elem ) ) {
69
- const recalculatedSecondaryColor = colorContrast (
70
- rgb2hex ( window . getComputedStyle ( elem ) . getPropertyValue ( 'color' ) ) ,
71
- ) ;
72
-
73
- elem . setAttribute ( 'contrast-color' , recalculatedSecondaryColor ) ;
74
- elem . state . secondaryColor = recalculatedSecondaryColor ;
68
+ if ( data . target . contains ) {
69
+ if ( data . target . contains ( elem ) ) {
70
+ const recalculatedSecondaryColor = colorContrast (
71
+ rgb2hex ( window . getComputedStyle ( elem ) . getPropertyValue ( 'color' ) ) ,
72
+ ) ;
73
+
74
+ elem . setAttribute ( 'contrast-color' , recalculatedSecondaryColor ) ;
75
+ elem . state . secondaryColor = recalculatedSecondaryColor ;
76
+ }
75
77
}
76
78
} ;
77
79
@@ -136,7 +138,7 @@ export class BoltIcon extends withPreact(withComponent()) {
136
138
{ background && size === 'xlarge' &&
137
139
< span className = { backgroundClasses } > </ span >
138
140
}
139
- </ div >
141
+ </ div >
140
142
) ;
141
143
}
142
144
}
You can’t perform that action at this time.
0 commit comments