aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2022-11-09 16:30:40 -0800
committerJohn MacFarlane <[email protected]>2022-11-09 17:03:12 -0800
commit334903bb9d7b7475666dcbb2c30b8d92339615a8 (patch)
treec47f1f0aaa0729a82760406ed53a5080a0d63ac9
parentcb5e3ded121eda1fa768f6d80d7cecd49fd6ca39 (diff)
HTML template: remove default font size, line height...
...and font family in default inline css. Closes #8423 (see comments there for motivation). `mainfont`, `fontsize`, and `linestretch` can still be used as before; the only difference is that we no longer provide opinionated defaults. This commit also adds a `maxwidth` variable that sets `max-width`; if not set, 36em is used as a default.
-rw-r--r--MANUAL.txt3
-rw-r--r--data/templates/styles.html16
-rw-r--r--test/lhs-test.html5
-rw-r--r--test/lhs-test.html+lhs5
-rw-r--r--test/writer.html45
-rw-r--r--test/writer.html55
6 files changed, 18 insertions, 21 deletions
diff --git a/MANUAL.txt b/MANUAL.txt
index 41a12df13..7a55cb29b 100644
--- a/MANUAL.txt
+++ b/MANUAL.txt
@@ -2641,6 +2641,9 @@ ODT or pptx.
: sets the CSS `line-height` property on the `html` element,
which is preferred to be unitless.
+`maxwidth`
+: sets the CSS `max-width` property (default is 32em).
+
`backgroundcolor`
: sets the CSS `background-color` property on the `html` element.
diff --git a/data/templates/styles.html b/data/templates/styles.html
index c21f1acab..bee9911d3 100644
--- a/data/templates/styles.html
+++ b/data/templates/styles.html
@@ -1,14 +1,20 @@
$if(document-css)$
html {
- line-height: $if(linestretch)$$linestretch$$else$1.5$endif$;
- font-family: $if(mainfont)$$mainfont$$else$Georgia, serif$endif$;
- font-size: $if(fontsize)$$fontsize$$else$20px$endif$;
+$if(mainfont)$
+ font-family: $mainfont$;
+$endif$
+$if(fontsize)$
+ font-size: $fontsize$;
+$endif$
+$if(linestretch)$
+ line-height: $linestretch$;
+$endif$
color: $if(fontcolor)$$fontcolor$$else$#1a1a1a$endif$;
background-color: $if(backgroundcolor)$$backgroundcolor$$else$#fdfdfd$endif$;
}
body {
margin: 0 auto;
- max-width: 36em;
+ max-width: $if(maxwidth)$$maxwidth$$else$36em$endif$;
padding-left: $if(margin-left)$$margin-left$$else$50px$endif$;
padding-right: $if(margin-right)$$margin-right$$else$50px$endif$;
padding-top: $if(margin-top)$$margin-top$$else$50px$endif$;
@@ -21,7 +27,7 @@ body {
@media (max-width: 600px) {
body {
font-size: 0.9em;
- padding: 1em;
+ padding: 12px;
}
h1 {
font-size: 1.8em;
diff --git a/test/lhs-test.html b/test/lhs-test.html
index b8e5efca7..d1c1ae5e3 100644
--- a/test/lhs-test.html
+++ b/test/lhs-test.html
@@ -7,9 +7,6 @@
<title>lhs-test</title>
<style>
html {
- line-height: 1.5;
- font-family: Georgia, serif;
- font-size: 20px;
color: #1a1a1a;
background-color: #fdfdfd;
}
@@ -28,7 +25,7 @@
@media (max-width: 600px) {
body {
font-size: 0.9em;
- padding: 1em;
+ padding: 12px;
}
h1 {
font-size: 1.8em;
diff --git a/test/lhs-test.html+lhs b/test/lhs-test.html+lhs
index 492fe2fa1..19abfd187 100644
--- a/test/lhs-test.html+lhs
+++ b/test/lhs-test.html+lhs
@@ -7,9 +7,6 @@
<title>lhs-test</title>
<style>
html {
- line-height: 1.5;
- font-family: Georgia, serif;
- font-size: 20px;
color: #1a1a1a;
background-color: #fdfdfd;
}
@@ -28,7 +25,7 @@
@media (max-width: 600px) {
body {
font-size: 0.9em;
- padding: 1em;
+ padding: 12px;
}
h1 {
font-size: 1.8em;
diff --git a/test/writer.html4 b/test/writer.html4
index e51ce0674..36708ab88 100644
--- a/test/writer.html4
+++ b/test/writer.html4
@@ -10,9 +10,6 @@
<title>Pandoc Test Suite</title>
<style type="text/css">
html {
- line-height: 1.5;
- font-family: Georgia, serif;
- font-size: 20px;
color: #1a1a1a;
background-color: #fdfdfd;
}
@@ -31,7 +28,7 @@
@media (max-width: 600px) {
body {
font-size: 0.9em;
- padding: 1em;
+ padding: 12px;
}
h1 {
font-size: 1.8em;
diff --git a/test/writer.html5 b/test/writer.html5
index 23df9ba80..c1b292f3d 100644
--- a/test/writer.html5
+++ b/test/writer.html5
@@ -10,9 +10,6 @@
<title>Pandoc Test Suite</title>
<style>
html {
- line-height: 1.5;
- font-family: Georgia, serif;
- font-size: 20px;
color: #1a1a1a;
background-color: #fdfdfd;
}
@@ -31,7 +28,7 @@
@media (max-width: 600px) {
body {
font-size: 0.9em;
- padding: 1em;
+ padding: 12px;
}
h1 {
font-size: 1.8em;