-
Notifications
You must be signed in to change notification settings - Fork 97
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
base: master
Are you sure you want to change the base?
docs: Oryx favicons #2443
Conversation
initialize(): void { | ||
super.initialize(); | ||
this.metaService?.add( | ||
// array with custom element definitions (ElementDefinition) |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
```html | ||
<link rel="icon" href="/public/logo.svg"> | ||
<link rel="icon" href="/public/logo.svg" media="(prefers-color-scheme: dark)"> | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```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. |
There was a problem hiding this comment.
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.
PR Description
Small documentation for favicon to explain how they're created and added.
Checklist