Comment

Comment by JunoNgx

Another small PWA-specific thing is the theme colour. I think you are only listening to `prefers-color-scheme`, so when the user manually switches between dark/light mode, there's a mismatch between the OS' status bar and the app's UI.

The solution to sync this correctly (or at least, the best one I have found so far) is to watch to the theme state change of the app, then query for `meta[name='theme-color']`, and set manually its `content` attribute to your desirable colour.

The theme colour you declare in the manifest and `<head>` of the html index is more of a fallback than anything.

I'm sure you'd figure it out, but let me know if you need something more detail; I would be happy to help.

parent JunoNgx 3 months ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton