Icon Styling
Created by: zlonko
This closes #5432. It centralizes our icons in a flexible component and updates styling across the About site.
Changelog
- Moves icons into
Icon
component- Accepts icon name, size, onClick, additional classes, etc.
- Implements new icon styling on
variant="boxed"
- Allows for plain icon when
variant
prop is omitted
- Uses the Material UI icon library identified in conversation with Tracey
Notes
- Spotify and Twitch logos are the only remaining mdi-react icons. They were not available in the library. Are we open to replacing these with SVGs?
- I ran into an issue rendering blogposts with
BlockquoteWithBorder
due to the inclusion of theIcon
component. TIL when a component is passed into another component, and then used as in MDX, Next does not use the Babel-aliased path when reading the component. So,Icon
needs to be imported with a relative path inBlockquoteWithBorder
for MDX to find it. - Still working on optimizing the bundle size (see comments in issue). From the MUI Docs it seems that tree-shaking should be happening automatically, and the site seems load quickly despite the larger bundle size measured on the production build. I am looking to learn more about this, so I appreciate any feedback!
Test
- Ensure prettier has standardized the proposed changes.
- Check that icons are rendered according to the new style on the following pages
-
/use-cases
and Use Case pages /code-insights
/case-studies/nutanix-fixed-log4j-with-sourcegraph
- Please check that there are no breaking changes with plain icons
- Arrows in carousels and blockquotes appear and function as expected
- Company logos (GitHub, Twitter, etc.) render at consistent sizes