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

Improve how we import and use icons #596

Open
Greenheart opened this issue May 23, 2024 · 0 comments
Open

Improve how we import and use icons #596

Greenheart opened this issue May 23, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Greenheart
Copy link
Collaborator

Greenheart commented May 23, 2024

The problem

In the current Next.js website, we use icons in many different ways. Sometimes imported as inline SVGs, styled via attributes. Other times, icons are imported as images. This makes it tricky to style the SVG icons, since some parts of the code depend on hard coded colors in the SVG icon file itself.

Suggested solution

For the Astro website, we could use https://github.com/unplugin/unplugin-icons to make it easier to access the icons we need in a consistent way. I've used this solution before and it solves a lot of common problems with handling icons, and it makes it easy to add new iconsets, while only adding the ones we actually use to the production bundle.

This will also make it easier to make icons behave consistently (for example when changing colors), since unplugin-icons supports several ways of styling.

After adding unplugin-icons, we could replace most of our custom icons with icon sets.

@Greenheart Greenheart added the enhancement New feature or request label May 23, 2024
@Greenheart Greenheart self-assigned this May 23, 2024
@elvbom elvbom moved this to Backlog in Klimatkollen web May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

1 participant