Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: adding icon component to easily use material icons #279

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

latin-panda
Copy link
Collaborator

@latin-panda latin-panda commented Jan 17, 2025

Closes #280

Adds material icon font
Adds icon component with two inputs:

  • alias: specifies the name of icon to render
  • size: icon size -- it can be expanded to small (sm) and large (lg)

I have verified this PR works in these browsers (latest versions):

  • Chrome
  • Firefox
  • Safari (macOS)
  • Safari (iOS)
  • Android
  • Not applicable

What else has been done to verify that this works as intended?

Sample of usage:

<Icon :alias="'print'" :size="'md-18'"/>
<Icon :alias="'drag_indicator'" :size="'md-24'"/>
<Icon :alias="'language'" :size="'md-36'"/>
<Icon :alias="'warning'" :size="'md-48'"/>

What it renders:
Screenshot 2025-01-17 at 5 14 18 PM

Why is this the best possible solution? Were any other approaches considered?

There are five steps to add an icon with IcoMoon, and there's a risk of accidentally deleting icons during this process.
This solution imports the material icons library, which is 264KB. Maybe it can be compressed even further using Gzip and other assets, but that's not the scope of this PR.

Because this project supports the latest version of browsers, I have included only woff2 (actually the Google's CDN for this font only provides woff2)

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

  • None

Do we need any specific form for testing your changes? If so, please attach one.

What's changed

  • No changes, just additions

Copy link

changeset-bot bot commented Jan 17, 2025

⚠️ No Changeset found

Latest commit: af39cbb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@latin-panda
Copy link
Collaborator Author

@eyelidlessness I kept getting issues with adding new icons to icoMoon, and I know we talked about having the svg inline. But it seemed like a low effort, so I went ahead and did this small PR. It will also make the Rank HTML cleaner :)

It's more of a proposal, and if you agree, then I will finish this PR, and I can also replace icoMoon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add all material icons
1 participant