lumeland / lume.land

The website of lume.land
https://lume.land
MIT License
68 stars 65 forks source link

Adaptive favicon #99

Closed kwaa closed 5 months ago

kwaa commented 6 months ago

This PR makes the favicon white in dark mode.

https://web.dev/articles/building/an-adaptive-favicon

netlify[bot] commented 6 months ago

Deploy Preview for lumeland ready!

Name Link
Latest commit a405bf0a790bcfb924659ec4c34706af0d1c1bed
Latest deploy log https://app.netlify.com/sites/lumeland/deploys/65a8e2450165b400087cd828
Deploy Preview https://deploy-preview-99--lumeland.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 site configuration.

kwaa commented 6 months ago

It looks like the changes don't display effectively due to the presence of the .ico icon.

oscarotero commented 6 months ago

At least in Firefox it doesn't work:

imaxe

But GitHub favicon changes, so there must be a way to do that...

kwaa commented 6 months ago

At least in Firefox it doesn't work

I'm guessing this is because the head also links favicon.ico.

<link href="/favicon.svg" rel="icon" type="image/svg+xml">
<link sizes="16x16 32x32" href="/favicon.ico" rel="icon">
oscarotero commented 6 months ago

yes, but the svg icon is declared before. In the network panel I see the svg file is downloaded

image
kwaa commented 6 months ago

yes, but the svg icon is declared before. In the network panel I see the svg file is downloaded

That's weird, I'll try removing favicon.ico and what happens. It is generated by plugin.

I don't see favicon.svg from either Chrome devtools or SpeedVitals Waterfall:

https://speedvitals.com/report/deploy-preview-99--lumeland.netlify.app/T5vPjh/

Opening the svg directly (https://deploy-preview-99--lumeland.netlify.app/favicon.svg) shows white (I manually changed the background to black to show the content):

image

oscarotero commented 5 months ago

Works like a charm. Thanks!