about summary refs log tree commit homepage
path: root/contrib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-01-20 04:21:07 +0000
committerEric Wong <e@80x24.org>2019-01-20 09:19:06 +0000
commitf026dbdd392c9dd5fddbdad9a2240738d4956640 (patch)
tree5aa0b82ac652c6c7bb6c0b9dc6bf43c28ced3d7b /contrib
parentdb62b87e5f844bba54f7323f42f9630208b13841 (diff)
downloadpublic-inbox-f026dbdd392c9dd5fddbdad9a2240738d4956640.tar.gz
Maybe we'll default to a dark theme to promote energy savings...

See contrib/css/README for details
Diffstat (limited to 'contrib')
-rw-r--r--contrib/css/216dark.css26
-rw-r--r--contrib/css/216light.css25
-rw-r--r--contrib/css/README41
3 files changed, 92 insertions, 0 deletions
diff --git a/contrib/css/216dark.css b/contrib/css/216dark.css
new file mode 100644
index 00000000..2fd85d08
--- /dev/null
+++ b/contrib/css/216dark.css
@@ -0,0 +1,26 @@
+/*
+ * Dark color scheme using 216 web-safe colors, inspired
+ * somewhat by the default color scheme in mutt.
+ * It reduces eyestrain for me, and energy usage for all:
+ * https://en.wikipedia.org/wiki/Light-on-dark_color_scheme
+ */
+* { background:#000; color:#ccc }
+
+/*
+ * Underlined links add visual noise which make them hard-to-read.
+ * Use colors to make them stand out, instead.
+ */
+a { color:#69f; text-decoration:none }
+a:visited { color:#96f }
+
+/* quoted text gets a different color */
+*.q { color:#09f }
+
+/*
+ * these may be used with cgit, too
+ * (cgit uses <div>, public-inbox uses <span>)
+ */
+*.add { color:#0ff }
+*.del { color:#f0f }
+*.head { color:#fff }
+*.hunk { color:#c93 }
diff --git a/contrib/css/216light.css b/contrib/css/216light.css
new file mode 100644
index 00000000..bf81bc57
--- /dev/null
+++ b/contrib/css/216light.css
@@ -0,0 +1,25 @@
+/*
+ * Light color scheme using 216 web-safe colors.
+ * Suitable for print, and blinding people with brightness.
+ * Haphazardly thrown together because bright colors hurt my eyes
+ */
+* { background:#fff; color:#333 }
+
+/*
+ * Underlined links add visual noise which make them hard-to-read.
+ * Use colors to make them stand out, instead.
+ */
+a { color:#00f; text-decoration:none }
+a:visited { color:#808 }
+
+/* quoted text gets a different color */
+*.q { color:#006 }
+
+/*
+ * these may be used with cgit, too
+ * (cgit uses <div>, public-inbox uses <span>)
+ */
+*.add { color:#060 }
+*.del {color:#900 }
+*.head { color:#000 }
+*.hunk { color:#960 }
diff --git a/contrib/css/README b/contrib/css/README
new file mode 100644
index 00000000..2473c2be
--- /dev/null
+++ b/contrib/css/README
@@ -0,0 +1,41 @@
+Example CSS for use with public-inbox.
+
+CSS::Minifier or CSS::Minifier::XS will be tried for minimizing
+CSS at startup if available(*).
+
+Multiple CSS files may be configured for user-selectability via
+the "title" attribute or for different media.  Local CSS files
+are read into memory once at startup.
+
+If only one CSS file is given without "title", it will be inlined.
+
+Snippet from ~/.public-inbox/config, order matters to browsers.
+-----8<-----
+[publicinbox]
+        ; Depending on the browser, the first entry is the default.
+        ; So having "/dev/null" at the top means no colors by default.
+        ; Using the "title" attribute enables `View -> "Page Style"'
+        ; choices in Firefox.
+        css = /dev/null title=default
+
+        ; git-config supports backslash to continue long lines
+        ; Attributes ('media', 'title') must use single quotes(')
+        ; or no quotes at all, but not double-quotes, as git-config(1)
+        ; won't preserve them:
+        css = /path/to/public-inbox/contrib/css/216dark.css \
+                title=216dark \
+                media='screen,(prefers-color-scheme:dark)'
+
+        ; for tree haters who print web pages :P
+        css = /path/to/public-inbox/contrib/css/216light.css \
+                title=216light \
+                media='screen,print,(prefers-color-scheme:light)'
+
+        ; external CSS may be specified with href.
+        ; Using "//" (protocol-relative) URLs is allowed, as is
+        ; "https://" or "http://" for hosts which only support one protocol.
+        css = href=//example.com/fugly.css title=external
+
+
+(*) "libcss-minifier-perl" or "libcss-minifier-xs-perl"
+    on Debian-based systems