Skip to content

Commit ebf6e44

Browse files
committed
✨ feat: Add support for light and dark mode favicons
1 parent 3c14804 commit ebf6e44

File tree

3 files changed

+59
-1
lines changed

3 files changed

+59
-1
lines changed

public/favicon-dark.svg

Lines changed: 47 additions & 0 deletions
Loading

public/images/favicon-dark.png

39.5 KB
Loading

src/layouts/Layout.astro

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,18 @@ const canonicalURL = new URL(Astro.url.pathname, Astro.site);
4141
name="twitter:image"
4242
content="https://carlosjorger.github.io/images/purple-logo.png"
4343
/>
44-
<link rel="icon" type="image/svg+xml" href="/images/favicon.png" />
44+
<link
45+
rel="icon"
46+
type="image/svg+xml"
47+
href="/images/favicon.png"
48+
media="(prefers-color-scheme: light)"
49+
/>
50+
<link
51+
rel="icon"
52+
type="image/svg+xml"
53+
href="/images/favicon-dark.png"
54+
media="(prefers-color-scheme: dark)"
55+
/>
4556
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
4657
<link
4758
rel="preload"

0 commit comments

Comments
 (0)