From: "Robin H. Johnson" <robbat2@gentoo.org>
To: meta@public-inbox.org
Subject: CSS behaviors bug report: dark/light switch non-functional
Date: Sun, 1 Sep 2024 05:07:22 +0000 [thread overview]
Message-ID: <robbat2-20240901T045635-169490258Z@orbis-terrarum.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 1369 bytes --]
I wanted to include a patch, but no obvious way without it being messy
really stood out, so this is only a bug report.
contrib/css describes using the 'prefers-color-scheme' media query
selector, but Gentoo got a report that the selection between light &
dark didn't work.
One of the other devs traced it down to nuances of the HTML link media
attribute: query expressions are not valid in the HTML variant in some
browsers.
This is also mentioned here:
https://stackoverflow.com/questions/69113672/loading-css-based-on-prefers-color-scheme-media-query
> Loading CSS based on any media query expression seems to be out of specification for the media attribute.
As a workaround, I merged the two files with a wrapper, but it feels
sub-optimal, because the entire text gets injected into the PI HTML.
```
@media(prefers-color-scheme: dark) {
... #content of 216dark
}
@media(prefers-color-scheme: light) {
... #content of 216light
}
```
I think the cleanest solution would be a variant of the above:
clauses, but with @import statements inside them, and making PI-httpd
expose all the CSS Files.
--
Robin Hugh Johnson
Gentoo Linux: Dev, Infra Lead, Foundation President & Treasurer
E-Mail : robbat2@gentoo.org
GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1113 bytes --]
next reply other threads:[~2024-09-01 5:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-01 5:07 Robin H. Johnson [this message]
2024-09-18 0:04 ` CSS behaviors bug report: dark/light switch non-functional Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=robbat2-20240901T045635-169490258Z@orbis-terrarum.net \
--to=robbat2@gentoo.org \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).