cassidyjames / ephemeral

A private-by-default, always-incognito browser for elementary OS
https://cassidyjames.com
GNU General Public License v3.0
154 stars 22 forks source link

Light/Dark toggle doesn't work with -dark stylesheets #231

Closed cassidyjames closed 4 years ago

cassidyjames commented 4 years ago

I think WebKit is looking for a -dark suffix in addition to a :dark theme variant, so the web styles are forced to always be dark. I see two options:

The latter has potential breakage, i.e. if there's an installed stylesheet called, foo-dark but not one called foo. In that case it will fall back to Adwaita, which is still probably fine. I believe this is a similar approach WebKit is taking for native input styling.

This directly affects Ubuntu 20.04 with their light/default/dark setting, as well as Pop!_OS (maybe since 19.04 or 19.10?) with their dark mode toggle that forces pop-dark.

p1u3o commented 4 years ago

The latter has potential breakage, i.e. if there's an installed stylesheet called, foo-dark but not one called foo. In that case it will fall back to Adwaita, which is still probably fine. I believe this is a similar approach WebKit is taking for native input styling.

I think Firefox might do this now too.

cassidyjames commented 4 years ago

Ugh, after spending way too much time poking at this, everything is terrible. I tried to get things to work with option 2 above, and it breaks being able to change the theme on Ubuntu after opening the app. I think I'll just implement the first option and drop the switcher if the OS or user is using ugly dark mode hacks.

cassidyjames commented 4 years ago

Both have been spiked out as PRs #233 (to hackily try to support -dark themes), and #234 (to hide the switch when using -dark themes).

Not sure which I am in favor of. #234 is certainly simpler.