Feature #366

Switch to using WebView's new built-in dark theme

Added by Rayleigh Rayleigh about 2 years ago. Updated 7 months ago.

Next Release
Start date:
Due date:
% Done:


Estimated time:


Ever since leaving Firefox I miss having every website in a dark theme. I used Stylus and this:
style to do it, and I could do it without having to enable JavaScript.
Is it possible for Privacy Browser to do a similar thing, that is apply a dark theme without using JS? Also, if not, some inspiration could be taken from the aformentioned theme, seen as PB's theme doesn' really look good most of the time.



Updated by Soren Stoutner about 2 years ago

  • Subject changed from Make dark theme better and work without JS. to Improve Night Mode CSS
  • Assignee set to Soren Stoutner

There is already a plan to allow Night Mode without JavaScript being enabled, but it cannot be implemented until after the release of Privacy WebView.

There is also a plan to let users customize the Night Mode CSS overrides, either globally or by domain.


Updated by Soren Stoutner about 2 years ago

As described at, Night Mode uses the following CSS overrides:

* {
    background-color: #212121 !important;
    color: #BDBDBD !important;
    box-shadow: none !important;
    text-decoration: none !important;
    text-shadow: none !important;
    border: none !important;

a {
    color: #1565C0 !important;

If you have recommendations for changes to the default CSS I would be happy to consider them. They would need to work well with the majority of websites.


Updated by Rayleigh Rayleigh about 2 years ago

Well, this ( theme is under CC BY-SA so I could take the CSS and modify it a bit to suit PB better.

It could also be done by just allowing the user to input their own theme, allowing a LOT of customisation.


Updated by Soren Stoutner about 2 years ago

This CSS code is released under the CC BY-NC-SA, which can't be included in Privacy Browser because it is a commercial product.

As I already mentioned, there is a plan to let users customize the CSS used by Night Mode.

However, just creating a field where users can paste CSS is problematic. The CSS syntax is very specific and it is unlikely that most users could figure it out. I am not totally opposed to the idea, but it would result in a large number of bug reports and emails, which takes away from the limited time I have to dedicate to the development of Privacy Browser.

For example, the CSS code you linked to could not be used directly in Privacy Browser without being modified to remove the header and the regexp sections.


Updated by Soren Stoutner about 2 years ago

  • Priority changed from 2 to 3.x

Updated by Soren Stoutner over 1 year ago

I am inclined to wait until after I see what Google does with Dark Mode in WebView before doing anything with this feature request.

However, if that doesn't work well, it would probably be possible to copy code from, which is released under the MIT (expat) license and could be included in Privacy Browser.


Updated by Soren Stoutner about 1 year ago

  • Priority changed from 3.x to Next Release

Updated by Soren Stoutner 7 months ago

  • Subject changed from Improve Night Mode CSS to Switch to using WebView's new built-in dark theme

Also available in: Atom PDF