Buttondown
A Markdown/MultiMarkdown/Pandoc HTML output CSS stylesheet
Author: Ryan Gray
Date: 15 Feb 2011
Revised: 21 Feb 2012
General style is clean, with minimal re-definition of the defaults or
overrides of user font settings. The body text and header styles are
left alone except title, author and date classes are centered. A Pandoc TOC
is not printed, URLs are printed after hyperlinks in parentheses.
Block quotes are italicized. Tables are lightly styled with lines above
and below the table and below the header with a boldface header. Code
blocks are line wrapped.
All elements that Pandoc and MultiMarkdown use should be listed here, even
if the style is empty so you can easily add styling to anything.
There are some elements in here for HTML5 output of Pandoc, but I have not
gotten around to testing that yet.
*/
Stuff tried and failed:
It seems that specifying font-family:serif in Safari will always use
Times New Roman rather than the user's preferences setting.
Making the font size different or a fixed value for print in case the screen
font size is making the print font too big: Making font-size different for
print than for screen causes horizontal lines to disappear in math when using
MathJax under Safari.
*/
body {
display: block;
font-size: 1em;
padding-left: 0;
padding-right: 0;
margin: 5pt 5pt;
}
Only appears if one of those three are in the document.
*/
div#header,
header {
border-bottom: 1px solid #aaa;
margin-bottom: 0.5em;
}
.title {
text-align: center;
}
.author,
.date {
text-align: center;
}
NOTE: this doesn't support Pandoc's --id-prefix option for #TOC and #header.
Probably would need to use div[id$='TOC'] and div[id$='header'] as selectors.
*/
div#TOC,
nav#TOC {
border-bottom: 1px solid #aaa;
margin-bottom: 0.5em;
}
@media print {
div#TOC,
nav#TOC {
display: none;
}
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: 'Helvetica Neue', Helvetica, 'Liberation Sans', Calibri, Arial,
sans-serif;
page-break-after: avoid;
}
p {
text-align: justify;
text-indent: 1em;
margin: 0;
}
blockquote {
font-style: italic;
}
li {
}
li > p {
margin-top: 1em;
}
ul {
}
ul li {
}
ol {
}
ol li {
}
hr {
}
sub {
}
sup {
}
em {
}
em > em {
font-style: normal;
}
strong {
}
a {
text-decoration: none;
}
@media screen {
a:hover {
text-decoration: underline;
}
}
@media print {
a {
color: black;
background: transparent;
}
a[href^='http://']:after,
a[href^='https://']:after {
so for http and https links, print the URL after what was the link
text in parens
*/
content: ' (' attr(href) ') ';
font-size: 90%;
}
}
img {
it in the middle to look nicer, but opinions differ, and if in a multi-line
paragraph, it might not be so great.
*/
vertical-align: middle;
text-align: center;
}
div.figure {
margin-left: auto;
margin-right: auto;
text-align: center;
font-style: italic;
}
p.caption {
}
pre,
code {
background-color: #fdf7ee;
white-space: pre-wrap;
white-space: -moz-pre-wrap !important;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;
}
pre {
padding: 0.5em;
border-radius: 5px;
border: 1px solid #aaa;
margin-left: 0.5em;
margin-right: 0.5em;
}
@media screen {
pre {
white-space: pre;
overflow: auto;
border: 1px dotted #777;
}
}
code {
}
p > code,
li > code {
padding-left: 2px;
padding-right: 2px;
}
li > p code {
padding: 2px;
}
span.math {
}
div.math {
}
span.LaTeX {
}
eq {
}
the header. Rows highlight on hover to help scanning the table on screen.
*/
table {
border-collapse: collapse;
border-spacing: 0;
border-bottom: 2pt solid #000;
border-top: 2pt solid #000;
margin-left: auto;
margin-right: auto;
}
thead {
border-bottom: 1pt solid #000;
background-color: #eee;
}
tr.header {
}
tbody {
}
tr {
}
tr.odd:hover,
tr.even:hover {
background-color: #eee;
}
tr.odd {
}
tr.even {
}
td,
th {
vertical-align: top;
vertical-align: baseline;
padding-left: 0.5em;
padding-right: 0.5em;
padding-top: 0.2em;
padding-bottom: 0.2em;
}
tr td:last-child, tr th:last-child
{
padding-right: 0;
}
tr td:first-child, tr th:first-child
{
padding-left: 0;
}
*/
th {
font-weight: bold;
}
tfoot {
}
caption {
caption-side: top;
border: none;
font-size: 0.9em;
font-style: italic;
text-align: center;
margin-bottom: 0.3em;
padding-bottom: 0.2em;
}
dl {
border-top: 2pt solid black;
padding-top: 0.5em;
border-bottom: 2pt solid black;
}
dt {
font-weight: bold;
}
dd + dt {
border-top: 1pt solid black;
padding-top: 0.5em;
}
dd {
margin-bottom: 0.5em;
}
dd + dd {
border-top: 1px solid black;
}
a.footnote,
a.footnoteRef {
font-size: small;
vertical-align: text-top;
}
a[href^='#fnref'],
a.reversefootnote {
}
@media print {
a[href^='#fnref'],
a.reversefootnote {
display: none;
}
}
div.footnotes {
}
div.footnotes li[id^='fn'] {
}
Useful since you can't set this media conditional inside an HTML element's
style attribute (I think), and you don't want to make another stylesheet that
imports this one and adds a class just to do this.
*/
@media print {
.noprint {
display: none;
}
}