Skip to content

Commit

Permalink
fix(icons): add color: inherit to mask icons for Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Dec 1, 2022
1 parent 71a5f98 commit c33a81d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/preset-icons/src/core.ts
Expand Up @@ -93,14 +93,16 @@ export function createPresetIcons(lookupIconLoader: (options: IconsOptions) => P
_mode = svg.includes('currentColor') ? 'mask' : 'bg'

if (_mode === 'mask') {
// Thanks to https://codepen.io/noahblon/post/coloring-svgs-in-css-background-images
// Thanks to https://codepen.io/noahblon/post/coloring-svgs-in-css-background-images
return {
'--un-icon': url,
'mask': 'var(--un-icon) no-repeat',
'mask-size': '100% 100%',
'-webkit-mask': 'var(--un-icon) no-repeat',
'-webkit-mask-size': '100% 100%',
'background-color': 'currentColor',
// for Safari https://github.com/elk-zone/elk/pull/264
'color': 'inherit',
...usedProps,
}
}
Expand Down

0 comments on commit c33a81d

Please sign in to comment.