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

docs: Oryx favicons #2443

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

docs: Oryx favicons #2443

wants to merge 2 commits into from

Conversation

tobi-or-not-tobi
Copy link
Contributor

PR Description

Small documentation for favicon to explain how they're created and added.

Checklist

  • I agree with the Code Contribution License Agreement in CONTRIBUTING.md

initialize(): void {
super.initialize();
this.metaService?.add(
// array with custom element definitions (ElementDefinition)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe let's add a real example?

template: concept-topic-template
---

Favicons, short for "favorite icons", are small, iconic images that represent a website or web application. They are typically displayed in the browser's address bar, tabs, and bookmarks. Creating a favicon involves designing an image that effectively conveys the identity of the web application in a small, recognizable format. Most brands use their logo or a variation of the logo in the favicon. The challenging part is often the limited available size.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd say there is near zero sense to explain what is favicon in frontend framework documentation :) So I'd shorten this section.

</svg>
```

The logo is referenced from a file. While favicons can be rendered inline in the meta data, as a base64 SVG, it is only recommended for a simple vector shape. Most logos will generate a large string in base64 and increases every (SSR rendered) page significantly. In case of a dark mode variation, it will be even worse. Moreover, a base64 based favicon cannot be cached and reused.
Copy link
Collaborator

Choose a reason for hiding this comment

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

In case of a dark mode variation, it will be even worse.

Maybe explanation why it will be even worse would be good.


Favicons, short for "favorite icons", are small, iconic images that represent a website or web application. They are typically displayed in the browser's address bar, tabs, and bookmarks. Creating a favicon involves designing an image that effectively conveys the identity of the web application in a small, recognizable format. Most brands use their logo or a variation of the logo in the favicon. The challenging part is often the limited available size.

## Technical format
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe Icon/Image format?


## Meta tags

Favicons can be added to a web page in different ways. Oryx prefers to add them in the header of the html. While dark mode is supported inline in the SVG, somehow browsers won't automatically rerender the favicon when the device color mode is changing. Therefore, the favicon is added twice in the html. This will cause a correct rerendering of the light vs dark mode favicon.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Favicons can be added to a web page in different ways. Oryx prefers to add them in the header of the html. While dark mode is supported inline in the SVG, somehow browsers won't automatically rerender the favicon when the device color mode is changing. Therefore, the favicon is added twice in the html. This will cause a correct rerendering of the light vs dark mode favicon.
Favicons can be added to a web page in different ways. Oryx prefers to add them in the head of the html document. While dark mode is supported inline in the SVG, somehow browsers won't automatically rerender the favicon when the device color mode is changing. Therefore, the favicon is added twice in the html. This will cause a correct rerendering of the light vs dark mode favicon.

Comment on lines +42 to +45
```html
<link rel="icon" href="/public/logo.svg">
<link rel="icon" href="/public/logo.svg" media="(prefers-color-scheme: dark)">
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
```html
<link rel="icon" href="/public/logo.svg">
<link rel="icon" href="/public/logo.svg" media="(prefers-color-scheme: dark)">
```
```html
<head>
...
<link rel="icon" href="/public/logo.svg">
<link rel="icon" href="/public/logo.svg" media="(prefers-color-scheme: dark)">
...
</head>

</svg>
```

The logo is referenced from a file. While favicons can be rendered inline in the meta data, as a base64 SVG, it is only recommended for a simple vector shape. Most logos will generate a large string in base64 and increases every (SSR rendered) page significantly. In case of a dark mode variation, it will be even worse. Moreover, a base64 based favicon cannot be cached and reused.
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you about adding an example of logo in base64 format? So we have an example for each case.

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

Successfully merging this pull request may close these issues.

2 participants