From 604021a1adf9bed492efa544f46cc549cc2159f2 Mon Sep 17 00:00:00 2001 From: surtur Date: Wed, 6 Apr 2022 13:59:46 +0200 Subject: [PATCH] qutebrowser: add user stylesheet+change bg colour replace the default 'white' bg and make sure that text colour is changed accordingly for 'body > pre' elements that contain e.g. raw code on gitea/github --- .config/qutebrowser/config.py | 6 +++++- .config/qutebrowser/stylesheets/user.css | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .config/qutebrowser/stylesheets/user.css diff --git a/.config/qutebrowser/config.py b/.config/qutebrowser/config.py index 3a58a33..67ad0d4 100644 --- a/.config/qutebrowser/config.py +++ b/.config/qutebrowser/config.py @@ -179,6 +179,10 @@ config.set('content.javascript.enabled', True, 'qute://*/*') # Type: Bool c.content.pdfjs = False +# List of user stylesheet filenames to use. +# Type: List of File, or File +c.content.user_stylesheets = 'stylesheets/user.css' + # CSS selectors used to determine which elements on a page should have # hints. # Type: Dict @@ -230,7 +234,7 @@ c.zoom.levels = ['25%', '33%', '50%', '67%', '75%', '90%', '100%', '110%', '120% # Background color for webpages if unset (or empty to use the theme's # color). # Type: QtColor -c.colors.webpage.bg = 'white' +c.colors.webpage.bg = '#1c1b22' # Default font size to use. Whenever "default_size" is used in a font # setting, it's replaced with the size listed here. Valid values are diff --git a/.config/qutebrowser/stylesheets/user.css b/.config/qutebrowser/stylesheets/user.css new file mode 100644 index 0000000..f6eb566 --- /dev/null +++ b/.config/qutebrowser/stylesheets/user.css @@ -0,0 +1,7 @@ +/* gitea/github raw code sites */ +body > pre +{ + color: #fbfbfe !important; + background-color: #1c1b22 !important; + background: #1c1b22 !important; +}