Closed cassidyjames closed 4 years ago
The assumption that both a light version exists and that version has a dark variant is surely not reliable.
@TingPing yeah, but it is true for the stylesheets I've looked at so far. Considering -dark
is not any spec at all and yet WebKit switches web content to be dark (instead of just listening to GTK's dark variant) means that there are already breaking assumptions all over, and if this works less-broken on Ubuntu and GNOME, I may ship it.
But it's a giant fucking mess and I'm really disappointed with platforms like Ubuntu pushing ahead with -dark
versions, as well as the lack of any sort of consensus on the GTK side as well (and work actively looking to be going in the wrong direction). I'd prefer not to hardcode the elementary stylesheet, but I might just end up doing that and give up on pretending to support my app on GNOME or any other platform.
I should note that the worst case is that it falls back to Adwaita, which I've tested against. So not the biggest deal. And if a GTK3 stylesheet doesn't ship a dark variant, I don't think this breaks in any way.
WebKit listens to both the dark preference and the theme name. Anyway I agree on that part being an undocumented assumption. I'm just not sure the assumptions here make any more sense.
This was intended to be a draft PR to just spike out the idea, anyway. #234 is an alternative, as discussed in #231.
I'm more of a fan of #234 as it has no real edge case to fail into unexpected behavior, even if unlikely.
@TingPing I am generally as well. If an OS ships a dark mode, the app will just fall in line and follow it. This probably more closely reflects what I'd do for an actually-supported dark mode as well.
Closing in favor of #234
Should work better with
-dark
forced themes, like on Ubuntu or GNOME (with Tweaks). Kinda a major hack.