summary refs log tree commit diff
path: root/doc/style.css
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2019-01-08 09:02:44 +0000
committerJörg Thalheim <joerg@thalheim.io>2019-01-08 15:08:42 +0000
commit06bcc2dee33d91b8d2632c92d44bd85eee23d8fc (patch)
tree9d40aee3e9902deb7f6b1428efaf244127bd8508 /doc/style.css
parent3a16c617e4c688bf28ed19caf7873e88f783f399 (diff)
downloadnixpkgs-06bcc2dee33d91b8d2632c92d44bd85eee23d8fc.tar
nixpkgs-06bcc2dee33d91b8d2632c92d44bd85eee23d8fc.tar.gz
nixpkgs-06bcc2dee33d91b8d2632c92d44bd85eee23d8fc.tar.bz2
nixpkgs-06bcc2dee33d91b8d2632c92d44bd85eee23d8fc.tar.lz
nixpkgs-06bcc2dee33d91b8d2632c92d44bd85eee23d8fc.tar.xz
nixpkgs-06bcc2dee33d91b8d2632c92d44bd85eee23d8fc.tar.zst
nixpkgs-06bcc2dee33d91b8d2632c92d44bd85eee23d8fc.zip
manual: limit text width
Currently the manual scales to the view port of the browser.
This leads to an unreadable layout and I found myself
reading the xml source instead.
The optimal width would be around 50 characters per line.
Since we have code listings also in the manual I relaxed
this limit a bit towards 70 characters per line.
Diffstat (limited to 'doc/style.css')
-rw-r--r--doc/style.css24
1 files changed, 22 insertions, 2 deletions
diff --git a/doc/style.css b/doc/style.css
index 0db907815b6..474dd32e3fb 100644
--- a/doc/style.css
+++ b/doc/style.css
@@ -9,6 +9,7 @@
 body
 {
     font-family: "Nimbus Sans L", sans-serif;
+    font-size: 1em;
     background: white;
     margin: 2em 1em 2em 1em;
 }
@@ -28,6 +29,25 @@ h2 /* chapters, appendices, subtitle */
     font-size: 180%;
 }
 
+div.book
+{
+    text-align: center;
+}
+
+div.book > div
+{
+    /*
+     * based on https://medium.com/@zkareemz/golden-ratio-62b3b6d4282a
+     * we do 70 characters per line to fit code listings better
+     * 70 * (font-size / 1.618)
+     * expression for emacs:
+     * (* 70 (/ 1 1.618))
+     */
+    max-width: 43.2em;
+    text-align: left;
+    margin: auto;
+}
+
 /* Extra space between chapters, appendices. */
 div.chapter > div.titlepage h2, div.appendix > div.titlepage h2
 {
@@ -102,8 +122,8 @@ pre.screen, pre.programlisting
 {
     border: 1px solid #b0b0b0;
     padding: 3px 3px;
-    margin-left: 1.5em;
-    margin-right: 1.5em;
+    margin-left: 0.5em;
+    margin-right: 0.5em;
 
     background: #f4f4f8;
     font-family: monospace;