Project

General

Profile

Actions

Feature #366

closed

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

Added by Anonymous almost 6 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Next Release
Start date:
01/02/2019
Due date:
% Done:

0%

Estimated time:

Description

Ever since leaving Firefox I miss having every website in a dark theme. I used Stylus and this: https://userstyles.org/styles/31267/global-dark-style-changes-everything-to-dark
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.

Actions #1

Updated by Soren Stoutner almost 6 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.

https://redmine.stoutner.com/issues/193

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

https://redmine.stoutner.com/issues/272

Actions #2

Updated by Soren Stoutner almost 6 years ago

As described at https://www.stoutner.com/privacy-browser-2-6/, 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.

Actions #3

Updated by Anonymous almost 6 years ago

Well, this (https://userstyles.org/styles/31267/global-dark-style-changes-everything-to-dark) 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.

Actions #4

Updated by Soren Stoutner almost 6 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.

https://redmine.stoutner.com/issues/272

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.

Actions #5

Updated by Soren Stoutner almost 6 years ago

  • Priority changed from 2 to 3.x
Actions #6

Updated by Soren Stoutner over 5 years 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.

https://9to5google.com/2019/02/19/android-chrome-webview-web-dark-mode/

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

Actions #8

Updated by Soren Stoutner almost 5 years ago

  • Priority changed from 3.x to Next Release
Actions #9

Updated by Soren Stoutner over 4 years ago

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

Also available in: Atom PDF