From 0e5612451f4ee4b2082de15d5f1ba0be9a28b0a6 Mon Sep 17 00:00:00 2001 From: Amy Lam Date: Mon, 17 Aug 2026 16:18:41 -0600 Subject: [PATCH] Make Safari honor the night sky's toolbar tint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to #63 for #60: the toolbar tint worked by day but stayed Safari's default grey at night. Two causes, both Safari-specific: - iOS Safari treats a bare theme-color meta as a light-mode suggestion and falls back to neutral grey chrome in dark mode. Ship a media-gated pair (light/dark) instead; sky.ts rewrites both each render so whichever one Safari is reading carries the current sky. - The static fallback was oklch(), which Safari's theme-color parser rejects — and a rejected value also lands on grey. The pair now starts from the midnight chip as plain hex. Belt and braces, body gets an explicit background-color (--sky-bottom): the gradient shorthand left it transparent, and Safari derives chrome and overscroll tint from background-color when it distrusts or lacks a theme-color — white/grey is the one thing a night sky must never fade into. Co-Authored-By: Claude Fable 5 --- README.md | 11 ++++++----- src/layouts/Layout.astro | 16 ++++++++++++---- src/scripts/sky.ts | 9 ++++++--- src/styles/global.css | 7 +++++++ 4 files changed, 31 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 99f0a15..85bc454 100644 --- a/README.md +++ b/README.md @@ -57,11 +57,12 @@ The background is your actual sky, computed in the browser: - **Controls**: the `▶︎ 24h` chip plays the whole day as a time-lapse; the `sky:` chip pins day or night (persisted in localStorage) for anyone who'd rather not read on a sunset. The status line and the - browser's own chrome follow along: every repaint rewrites a - `theme-color` meta tag with the horizon's computed chip color, so - mobile Safari's toolbar tints to match the sky instead of keeping - whatever it sampled at load. In the dev console, - `__skyAt('2026-07-16T20:30')` previews any moment. + browser's own chrome follow along: every repaint rewrites a pair of + `theme-color` meta tags (one per light/dark color scheme — iOS Safari + ignores a bare one in dark mode and shows grey chrome) with the + horizon's computed chip color, so mobile Safari's toolbar tints to + match the sky instead of keeping whatever it sampled at load. In the + dev console, `__skyAt('2026-07-16T20:30')` previews any moment. The page paints immediately with the fallback sky, then refines once the geo lookup resolves, and re-renders every minute. diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 1abaa37..64b80e5 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -20,10 +20,18 @@ const ogImage = new URL('/og.png', Astro.site); - - + + + {title}