mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
replaced icons with masked rects
This commit is contained in:
parent
d17a7b6aef
commit
130e62455d
3 changed files with 32 additions and 18 deletions
|
@ -3,7 +3,12 @@ import sprite from '$sprites/icon.svg';
|
|||
|
||||
export const Icon = ({ icon, size = 32 }) => (
|
||||
<svg width={size} height={size} viewBox="0 0 32 32">
|
||||
<use xlinkHref={`${sprite}#${icon}`} x={0} y={0} />
|
||||
<defs>
|
||||
<mask id={`icon-mask-${icon}`}>
|
||||
<use xlinkHref={`${sprite}#${icon}`} x={0} y={0} />
|
||||
</mask>
|
||||
</defs>
|
||||
<rect x="0" y="0" width="32" height="32" stroke="none" mask={`url(#icon-mask-${icon})`} />
|
||||
</svg>
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue