chiark / gitweb /
css: make code font size configurable from the theme.
authorVladimír Vondruš <mosra@centrum.cz>
Sun, 17 Jun 2018 09:52:18 +0000 (11:52 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Sun, 17 Jun 2018 11:06:50 +0000 (13:06 +0200)
Not every combination of font and monospace font works with scaling the
code to 0.9 -- the light theme has base font size only 14px and there
the code would be too small. Also use `em` instead of `rem` so it
follows surrounding text size.

css/m-components.css
css/m-dark+doxygen.compiled.css
css/m-dark.compiled.css
css/m-light+doxygen.compiled.css
css/m-light.compiled.css
css/m-theme-dark.css
css/m-theme-light.css

index 55bec646719779b06003320c4b157ff76a6ce5f6..496e989523f64447a296514a416747f1bb684af6 100644 (file)
@@ -80,7 +80,7 @@ blockquote, hr {
 }
 pre {
   font-family: var(--code-font), monospace, monospace; /* https://en.wikipedia.org/wiki/User:Davidgothberg/Test59 */
-  font-size: 0.9rem;
+  font-size: var(--code-font-size);
   padding: 0.5rem 1rem;
   color: var(--code-color);
   background-color: var(--code-background-color);
@@ -120,7 +120,7 @@ mark {
 }
 code {
   font-family: var(--code-font), monospace, monospace;
-  font-size: 0.9rem;
+  font-size: var(--code-font-size);
   padding: 0.125rem;
   color: var(--code-color);
   background-color: var(--code-background-color);
index 252a16d165640786469141c51b20ffbc4f23a8c4..3f8fd7760a1d4df7e9b5497ce5fc7b15b9c6f2f1 100644 (file)
@@ -441,7 +441,7 @@ blockquote, hr {
 }
 pre {
   font-family: 'Source Code Pro', monospace, monospace, monospace;
-  font-size: 0.9rem;
+  font-size: 0.9em;
   padding: 0.5rem 1rem;
   color: #e6e6e6;
   background-color: #282e36;
@@ -479,7 +479,7 @@ mark {
 }
 code {
   font-family: 'Source Code Pro', monospace, monospace, monospace;
-  font-size: 0.9rem;
+  font-size: 0.9em;
   padding: 0.125rem;
   color: #e6e6e6;
   background-color: #282e36;
index ee86e350f182f3b619a06416ab4e6336ada5e7e2..c17e1d3bbc6d1bb441d505aa8d01fd927148b288 100644 (file)
@@ -441,7 +441,7 @@ blockquote, hr {
 }
 pre {
   font-family: 'Source Code Pro', monospace, monospace, monospace;
-  font-size: 0.9rem;
+  font-size: 0.9em;
   padding: 0.5rem 1rem;
   color: #e6e6e6;
   background-color: #282e36;
@@ -479,7 +479,7 @@ mark {
 }
 code {
   font-family: 'Source Code Pro', monospace, monospace, monospace;
-  font-size: 0.9rem;
+  font-size: 0.9em;
   padding: 0.125rem;
   color: #e6e6e6;
   background-color: #282e36;
index 835c9e287cfde6d5551aaf9ee4c174832d810135..668c06bcf8fcc3e781c892ee6117454e61b65542 100644 (file)
@@ -441,7 +441,7 @@ blockquote, hr {
 }
 pre {
   font-family: 'Source Code Pro', monospace, monospace, monospace;
-  font-size: 0.9rem;
+  font-size: 1em;
   padding: 0.5rem 1rem;
   color: #5b5b5b;
   background-color: #fbf0ec;
@@ -479,7 +479,7 @@ mark {
 }
 code {
   font-family: 'Source Code Pro', monospace, monospace, monospace;
-  font-size: 0.9rem;
+  font-size: 1em;
   padding: 0.125rem;
   color: #5b5b5b;
   background-color: #fbf0ec;
index e5c82ae5b75050391a28c2442588998c9acb0f6b..35674baa3f032c74fe6b7e7cd3424387ee442d25 100644 (file)
@@ -441,7 +441,7 @@ blockquote, hr {
 }
 pre {
   font-family: 'Source Code Pro', monospace, monospace, monospace;
-  font-size: 0.9rem;
+  font-size: 1em;
   padding: 0.5rem 1rem;
   color: #5b5b5b;
   background-color: #fbf0ec;
@@ -479,7 +479,7 @@ mark {
 }
 code {
   font-family: 'Source Code Pro', monospace, monospace, monospace;
-  font-size: 0.9rem;
+  font-size: 1em;
   padding: 0.125rem;
   color: #5b5b5b;
   background-color: #fbf0ec;
index 8f328d9251d3f2af356dc990a2b9101db3cbd037..47764484fe762216f27571fd216e977cac84d366 100644 (file)
@@ -27,6 +27,7 @@
   --font: 'Source Sans Pro', sans-serif;
   --code-font: 'Source Code Pro', monospace;
   --font-size: 16px;
+  --code-font-size: 0.9em; /* *not* rem, so it follows surrounding font size */
   --paragraph-indent: 1.5rem;
   --paragraph-align: justify;
   --link-decoration: underline;
index c6f13842088436fdb625ed20bbbf7f2b19c65d9e..c84b7df9df303ec1f4258b18732811edf9b66d48 100644 (file)
@@ -27,6 +27,7 @@
   --font: 'Libre Baskerville', serif;
   --code-font: 'Source Code Pro', monospace;
   --font-size: 14px;
+  --code-font-size: 1em; /* *not* rem, so it follows surrounding font size */
   --paragraph-indent: 1.5rem;
   --paragraph-align: justify;
   --link-decoration: underline;