]> Sergey Matveev's repositories - public-inbox.git/commitdiff
Duplicate base css definitions in stylesheets
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>
Mon, 16 Aug 2021 14:50:15 +0000 (10:50 -0400)
committerEric Wong <e@80x24.org>
Mon, 16 Aug 2021 22:13:03 +0000 (22:13 +0000)
All pages carry the following inlined css declaration:

    <style>pre{white-space:pre-wrap}*{font-size:100%;font-family:monospace}</style>

However, site security policies may deliberately prohibit execution of
inline content such as scripts and stylesheets as an extra layer of
protection against XSS vulnerabilities. For example, with the following
HTTP headers returned by the server, the inline styles above will be
ignored:

    Content-Security-Policy: default-src 'self'

This causes public-inbox content to be rendered poorly on mobile devices
due to the default <pre> behaviour. Duplicating this declaration into
the contrib stylesheets makes sure that these styles are applied even
with the strictest security policies in place.

Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
contrib/css/216dark.css
contrib/css/216light.css

index 02804cbdd03e4764211b35a7ee884cb4017fa313..1277a49afaeb0d9222ca0094d1e78a5553b97ff0 100644 (file)
@@ -5,7 +5,8 @@
  * It reduces eyestrain for me, and energy usage for all:
  * https://en.wikipedia.org/wiki/Light-on-dark_color_scheme
  */
-* { background:#000; color:#ccc }
+* { font-size: 100%; font-family: monospace; background:#000; color:#ccc }
+pre { white-space: pre-wrap }
 
 /*
  * Underlined links add visual noise which make them hard-to-read.
index c66cfdfe89ff5a85ebaca2adfb9b744ef3b1b80e..741214c94301288bcf67c66f8d57f1a1b7eafc48 100644 (file)
@@ -4,7 +4,8 @@
  * Suitable for print, and blinding people with brightness.
  * Haphazardly thrown together because bright colors hurt my eyes
  */
-* { background:#fff; color:#333 }
+* { font-size: 100%; font-family: monospace; background:#fff; color:#333 }
+pre { white-space: pre-wrap }
 
 /*
  * Underlined links add visual noise which make them hard-to-read.