Putting aside that it’s a bad idea for accessibility reasons, is it possible to enforce dark mode on a web page in Safari, _without_ JS? Usual setup: the page uses implicitly light-mode CSS, with a prefers-color-scheme selector to specify the dark-mode styles (via :root variables). All works fine responding to the system setting. But, adding (say) a META color-scheme of “only dark” does nothing.

@Geoffairey I’m talking about the site itself, not the user. E.g. causing a given page on one’s own site to always be rendered with the dark-mode appearance, without resorting to using JS to toggle styles.

Follow

@mattgemmell @Geoffairey huh? Why not just dark colours in the first place then? Struggling to see your use case.

@falken @Geoffairey What I’d like is for a given page to “insist upon” the site’s dark-mode appearance, regardless of the user’s system setting, without serving different CSS for that page. The site’s global CSS already specifies both light and dark appearances via the usual color-scheme method. It would seem reasonable to want to use those.

@mattgemmell @Geoffairey ah, OK. If you don't want to serve different CSS, but you are generating the CSS, could you have the same dark color variables used as defaults inside a 'body.dark-mode' selector, right?
For hand rolled CSS... Dunno...

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.