Skip to content

refactor: Replace icon font with SVG icons #790

Open
MoritzWeber0 wants to merge 5 commits intomainfrom
refactor/svg-icons
Open

refactor: Replace icon font with SVG icons #790
MoritzWeber0 wants to merge 5 commits intomainfrom
refactor/svg-icons

Conversation

@MoritzWeber0
Copy link
Copy Markdown
Member

  • Only load used icons via SVGs instead of loading all icons via the font (this is more efficient as GitHub pages has no proper caching)

  • Avoid rendering issues when using slow internet connections:

    image

See also this discussion: #419 (comment)

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 29, 2026

Deploy Preview for fipguide ready!

Name Link
🔨 Latest commit 278b330
🔍 Latest deploy log https://app.netlify.com/projects/fipguide/deploys/69d523d7034db9000842c38e
😎 Deploy Preview https://deploy-preview-790--fipguide.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Copy Markdown

Hi there! 👋

Thank you for your contribution to the FIP Guide! 🚀
We appreciate your effort in making rail staff travel information more accessible. 🚄

Checklist before merging:

  • Added a description to the Pull Request
  • Checked the License of new pictures (non-commercial use without attribution)
  • Modified content in English
  • Modified content in German
  • Modified content in French

@MoritzWeber0 MoritzWeber0 requested a review from therobrob March 29, 2026 13:49
@MoritzWeber0 MoritzWeber0 added the technical Technical issues, e.g. related to Hugo, HTML, CSS, deployment, etc. label Mar 29, 2026
Copy link
Copy Markdown
Member

@therobrob therobrob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you Moritz :) the icons have an other size than before, is this intended? In addition to the comments below, I noticed that the icons of the highlights are much smaller (14x14px), also of the buttons (15x15px) and dialog-close (15x15px). The line thickness of all icons is also different. The icon of the copy-toast is a little too high up.

Image

Image

}

.a-icon {
font-size: 1.2em;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the icon is smaller than before, it should be 20x20px

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the general size increase, it's now 17x17 vs 18x18 on my side. I do think it looks slightly better with the alignment:

Before:
grafik

After:
grafik

If you like the previous icon more, I can increase the font-size to 1.25em, then it's ~18px on my side again.

Comment on lines +116 to +117
width: 1em;
height: 1em;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the icons are smaller than before, it should be 20x20px

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me the icons (size of the ::before element) is 18x18, so it probably depends on the device settings for scaling. However, I increased the default width / height to 1.125rem to better match the previous state. Still not 100% the same, but I don't recognize a visual change.

}

> .a-icon {
font-size: 1.15em;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the icon is larger than before, it should be 20x20px

display: block;
position: absolute;
top: 23px;
top: 22px;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
top: 22px;
top: 20px;

Comment on lines +155 to 163
content: "";
display: block;
width: 1.8rem;
height: 1.8rem;
background-color: currentColor;
mask: url("/icons/material-symbols-rounded/subdirectory_arrow_right.svg")
no-repeat center / contain;
position: absolute;
left: -2.4rem;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The icons are a little too high up. We should add:
top: 0;

@MoritzWeber0
Copy link
Copy Markdown
Member Author

thank you Moritz :) the icons have an other size than before, is this intended? In addition to the comments below, I noticed that the icons of the highlights are much smaller (14x14px), also of the buttons (15x15px) and dialog-close (15x15px).

To some extend the size of the icons will vary as it's not straightforward to represent the exact size of the font. To be able to control the size of the icons via the font-size attribute as it was done before (and also makes sense to match the current text size for in-line icons), I use the em property, which is calculated considering parent elements, so the resulting numbers can be odd sometimes, but that's just a technical detail and shouldn't have larger visual effects.

I'll check the mentioned issues and will fix them as best as possible, thanks for checking 👍

The line thickness of all icons is also different. The icon of the copy-toast is a little too high up.

I couldn't find a way to derive the icon weight (different file) via the CSS weight / bold property. So for simplicity reasons, I removed the icons with weight 400 for now and just kept using the icons with weight 700; in comparison I liked them more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

technical Technical issues, e.g. related to Hugo, HTML, CSS, deployment, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants