Page MenuHomePhabricator

docs: add favicon
Closed, ResolvedPublic

Description

Overview

Favicons improve user experience and enforce brand consistency.[1] They are typically applied via the link element within the head element. [2]

<head>
<link rel="icon" href="/favicon.ico">
</head>

Goal: Replace the existing Wikimedia logo favicon [3] [4] on the Codex docs site with the Codex logo.

References:

  1. https://developer.mozilla.org/en-US/docs/Glossary/Favicon
  2. https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link#providing_icons_for_different_usage_contexts
  3. https://gerrit.wikimedia.org/r/plugins/gitiles/integration/docroot/+/refs/heads/master/shared/favicon.ico
  4. https://gerrit.wikimedia.org/r/plugins/gitiles/integration/docroot/+/refs/heads/master/shared/WikimediaUiThemePageBase.php#30

Acceptance criteria

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change #1165610 had a related patch set uploaded (by LWatson; author: LWatson):

[design/codex@main] [PoC] docs: add favicon

https://gerrit.wikimedia.org/r/1165610

@lwatson is this something you are working on? Can we mark it In Progress or Code Review on the board and assign yourself?

@DTorsani-WMF I can continue working on this. I initially wrote up a ticket and submitted a proof-of-concept patch because I don't have the proper favicon size and formats. Favicons are typically 16-pixel square icons (eg. 32x32, 16x16). Volker provided feedback, and the patch is no longer a proof-of-concept. This demo includes a 20x20 SVG icon (a blue version of cdxIconLogoCodex). The SVG favicon is supported in FireFox and Chrome.

What's next?

  • Update the favicon.svg from 20x20 to 32x32 SVG
  • Add a 16x16 or 32x32 favicon.ico to support most browsers. If a 32x32 size is used, then ensure that it can scale down well enough to 16x16.

Okay great, sounds good. Do you need anything from design or anyone else to continue this work?

DTorsani-WMF triaged this task as Low priority.
DTorsani-WMF moved this task from Backlog to In Progress on the Codex board.

@DTorsani-WMF I assume the favicon asset should live in Figma, so I'll need help creating the 32x32 SVG and adding it to Figma. I haven't looked into this yet to do it myself

I'm not sure an entire set needs to live in Figma. Since it is just the Codex logo in blue, that can be easily created and exported any time we need a new one. For now, here is the 32x32 SVG file. Let me know if you need anything else.

Change #1165610 merged by jenkins-bot:

[design/codex@main] docs: add favicon

https://gerrit.wikimedia.org/r/1165610

Thanks @DTorsani-WMF - I'll open a follow-up patch using the image you provided. I tried resizing the Codex logo icon in Figma by adjusting the SVG's height and width and then adding padding with auto-layout to prevent excessive cropping of the image. Is that how it's created?

Change #1167994 had a related patch set uploaded (by LWatson; author: LWatson):

[design/codex@main] docs: add favicon types

https://gerrit.wikimedia.org/r/1167994

Patch 1165610 was merged, and that favicon isn't loading on the main branch https://doc.wikimedia.org/codex/main/

Patch 1167994 includes the 32x32 SVG that Derek provided. I converted the 32x32 SVG to 16x16 ICO using https://www.favicon-generator.org/, which didn't turn out well. The quality is poor, and it's causing an "Unclosed bracket CssSyntaxError" in the favicon.ico file.

SVG
Screenshot 2025-07-10 at 9.57.49 PM.png (68×58 px, 7 KB)
ICO
Screenshot 2025-07-10 at 9.57.30 PM.png (66×56 px, 7 KB)
lwatson changed the task status from Open to In Progress.Jul 11 2025, 2:22 AM
lwatson updated the task description. (Show Details)

@Volker_E I think we should revert this patch https://gerrit.wikimedia.org/r/c/design/codex/+/1165610 because the favicons are not displaying on the main branch. I'm guessing they won't load on the latest branch either. What do you think?

I just resized the Codex logo icon in Figma and made it blue. Can we not just use a larger PNG for the favicon? That seems pretty common these days.

Cool! I used a different converter tool (favicon.io), which provides a set of favicons and a better quality favicon.ico. I updated the SVG (32x32) and ICO, and introduced a PNG (32x32) in patch 1167994. Here's the demo preview link.

That looks good to me! Let me know when you would a review from me on the patch.

Change #1167994 merged by jenkins-bot:

[design/codex@main] docs: add favicon types

https://gerrit.wikimedia.org/r/1167994

@Volker_E I think we should revert this patch https://gerrit.wikimedia.org/r/c/design/codex/+/1165610 because the favicons are not displaying on the main branch. I'm guessing they won't load on the latest branch either. What do you think?

Saw this comment just right now. I guess the refinements and addition of fallback ICO (and SVG) have provided the necessary compatibility.

Change #1171718 had a related patch set uploaded (by Catrope; author: Catrope):

[mediawiki/core@master] Update Codex from v2.2.0 to v2.2.1

https://gerrit.wikimedia.org/r/1171718

Change #1171718 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v2.2.0 to v2.2.1

https://gerrit.wikimedia.org/r/1171718