Skip to content

Commit ff76843

Browse files
committed
feat: enable themed favicon
The colour of the logo in the favicon is determined by a stylesheet in the SVG itself - it uses `prefers-color-scheme` in order to colour the logo. It does not follow the theme of the website but follows the browser/OS choice. The SVG in this commit had to be manually edited, since Inkscape didn't want to play nice with the CSS. If this file gets edited in the future, be careful to not accidentally break this functionality. Using an SVG here was preferred over using the existing `favicon-white.png` and `favicon.ico` because Docusaurus did not provide a handy feature to toggle between the light/dark mode favicons, in the same way that it did for the logo in the navbar (with `navbar.logo.src` and `navbar.logo.srcDark`).
1 parent 3d4ee49 commit ff76843

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = {
1515
baseUrl: '/',
1616
trailingSlash: false,
1717
onBrokenLinks: 'throw',
18-
favicon: 'img/favicon.ico',
18+
favicon: 'img/favicon-auto.svg',
1919
organizationName: 'wokwi',
2020
projectName: 'wokwi-docs',
2121
scripts: [

static/img/favicon-auto.svg

Lines changed: 50 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)