Skip to content

Commit cd45855

Browse files
authored
Use picture element for navbar logo (#199)
1 parent 5540be3 commit cd45855

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/layout/NavBar.astro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ import LogoMarkerLight from "@/assets/brand/logo-marker-light.svg";
1616
<Icon name="icons/heroicons/menu" class="size-6 fill-gray-500" />
1717
</button>
1818
<a href="/" class="leading-none" tabindex="-1" aria-hidden={true}>
19-
<img src={LogoMarkerLight.src} alt="PaperMC" class="block h-12 cursor-pointer dark:hidden" />
20-
<img src={LogoMarkerDark.src} alt="PaperMC" class="hidden h-12 cursor-pointer dark:block" />
19+
<picture>
20+
<source srcset={LogoMarkerDark.src} media="(prefers-color-scheme: dark)" />
21+
<img src={LogoMarkerLight.src} alt="PaperMC" class="block h-12 cursor-pointer" />
22+
</picture>
2123
</a>
2224
<div
2325
id="nav-menu"

0 commit comments

Comments
 (0)