Skip to content

Commit

Permalink
refactor: set background-image for icons on Firefox (#11539)
Browse files Browse the repository at this point in the history
  • Loading branch information
swkatmask committed Apr 1, 2024
1 parent cdcc39e commit 2765699
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/icons/utils/internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ export function __createIcon(name, variants, intrinsicSize = [24, 24]) {
// To align icon center.
fontSize: 0,
}
// background image can't be correctly resolved on Firefly in ShadowDOM.
// This is a workaround.
// https://mask.atlassian.net/browse/FW-564
if (iconStyle.backgroundImage && navigator.userAgent.includes('Firefox')) {
iconProps.style = {
...iconProps.style,
backgroundImage: iconStyle.backgroundImage,
}
}
if (hasClickHandler) {
iconProps['aria-hidden'] = false
iconProps['role'] = 'button'
Expand Down

0 comments on commit 2765699

Please sign in to comment.