`<Icon />`: Update component for more control over `<svg>` element
Created by: umpox
Description
We ran into some issues when migrating to use the @mdi/react
<Icon />
component:
- Color was set on
<path>
elements - It wasn't possible to set the
height
andwidth
attributes. The component doesn't support passing through normal SVG props.
We don't need to use this component now we have the paths through @mdi/js
, we can just roll our own that is similar to our setup with mdi-react
, but can also add some of the benefits that we'd get from @mdi/react
.
Note I haven't included the
title
anddescription
logic. As we are usingrole="img"
andaria-label|hidden
, this isn't as important anymore. One of the issues I noticed is thattitle
also gives a secondary tooltip on long hovers, which isn't intended (as opposed to our actual tooltip usage).
Test plan
Tested locally and in Storybook. Visual regression tests to confirm no UX changes.
App preview:
Check out the client app preview documentation to learn more.