From 51a29ba366214289ca710d8bc77ce1c732b27cfe Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Jun 2018 11:52:18 +0200 Subject: [PATCH] css: make code font size configurable from the theme. 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 | 4 ++-- css/m-dark+doxygen.compiled.css | 4 ++-- css/m-dark.compiled.css | 4 ++-- css/m-light+doxygen.compiled.css | 4 ++-- css/m-light.compiled.css | 4 ++-- css/m-theme-dark.css | 1 + css/m-theme-light.css | 1 + 7 files changed, 12 insertions(+), 10 deletions(-) diff --git a/css/m-components.css b/css/m-components.css index 55bec646..496e9895 100644 --- a/css/m-components.css +++ b/css/m-components.css @@ -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); diff --git a/css/m-dark+doxygen.compiled.css b/css/m-dark+doxygen.compiled.css index 252a16d1..3f8fd776 100644 --- a/css/m-dark+doxygen.compiled.css +++ b/css/m-dark+doxygen.compiled.css @@ -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; diff --git a/css/m-dark.compiled.css b/css/m-dark.compiled.css index ee86e350..c17e1d3b 100644 --- a/css/m-dark.compiled.css +++ b/css/m-dark.compiled.css @@ -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; diff --git a/css/m-light+doxygen.compiled.css b/css/m-light+doxygen.compiled.css index 835c9e28..668c06bc 100644 --- a/css/m-light+doxygen.compiled.css +++ b/css/m-light+doxygen.compiled.css @@ -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; diff --git a/css/m-light.compiled.css b/css/m-light.compiled.css index e5c82ae5..35674baa 100644 --- a/css/m-light.compiled.css +++ b/css/m-light.compiled.css @@ -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; diff --git a/css/m-theme-dark.css b/css/m-theme-dark.css index 8f328d92..47764484 100644 --- a/css/m-theme-dark.css +++ b/css/m-theme-dark.css @@ -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; diff --git a/css/m-theme-light.css b/css/m-theme-light.css index c6f13842..c84b7df9 100644 --- a/css/m-theme-light.css +++ b/css/m-theme-light.css @@ -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; -- 2.30.2