latex-css/style.css
Vincent Dörig 5f9a2ea6eb Improve styles
- remove css variable
- add horizontal padding on the body
- add table styling
- add heading typography
2020-05-21 10:03:48 +02:00

360 lines
5.8 KiB
CSS
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@font-face {
font-family: "Latin Modern";
font-style: normal;
font-weight: normal;
font-display: swap;
src: url("./fonts/LM-regular.woff2") format("woff2"),
url("./fonts/LM-regular.woff") format("woff"),
url("./fonts/LM-regular.ttf") format("truetype");
}
@font-face {
font-family: "Latin Modern";
font-style: italic;
font-weight: normal;
font-display: swap;
src: url("./fonts/LM-italic.woff2") format("woff2"),
url("./fonts/LM-italic.woff") format("woff"),
url("./fonts/LM-italic.ttf") format("truetype");
}
@font-face {
font-family: "Latin Modern";
font-style: normal;
font-weight: bold;
font-display: swap;
src: url("./fonts/LM-bold.woff2") format("woff2"),
url("./fonts/LM-bold.woff") format("woff"),
url("./fonts/LM-bold.ttf") format("truetype");
}
@font-face {
font-family: "Latin Modern";
font-style: italic;
font-weight: bold;
font-display: swap;
src: url("./fonts/LM-bold-italic.woff2") format("woff2"),
url("./fonts/LM-bold-italic.woff") format("woff"),
url("./fonts/LM-bold-italic.ttf") format("truetype");
}
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
ul[class],
ol[class],
li,
figure,
figcaption,
dl,
dd {
margin: 0;
}
/* Make default font-size 1rem and add smooth scrolling to anchors */
html {
font-size: 1rem;
scroll-behavior: smooth;
}
body {
font-family: "Latin Modern", Georgia, Cambria, "Times New Roman", Times,
serif;
line-height: 1.8;
max-width: 80ch;
min-height: 100vh;
margin: 0 auto;
padding: 2rem 1.25rem;
counter-reset: theorem;
counter-reset: definition;
color: hsl(0, 5%, 10%);
background-color: hsl(210, 20%, 98%);
text-rendering: optimizeSpeed;
}
/* Justify and hyphenate all paragraphs */
p {
text-align: justify;
hyphens: auto;
-webkit-hyphens: auto;
-moz-hyphens: auto;
}
/* A elements that don't have a class get default styles */
a:not([class]) {
text-decoration-skip-ink: auto;
}
/* Make links red */
a,
a:visited {
color: #a00;
}
/* Make images easier to work with */
img {
max-width: 100%;
display: block;
}
/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
font: inherit;
}
/* Natural flow and rhythm in articles by default */
article > * + * {
margin-top: 1em;
}
/* Styles for inline code or code snippets */
code,
pre,
kbd {
font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
monospace;
font-size: 85%;
}
pre {
padding: 1rem 1.4rem;
max-width: 100%;
overflow: auto;
border: 1px solid hsl(210, 15%, 49%);
border-radius: 4px;
background: hsl(210, 40%, 96%);
}
pre code {
font-size: 95%;
position: relative;
}
/* Make table 100% width, add borders between rows */
table {
border-collapse: collapse;
border-spacing: 0;
width: 100%;
max-width: 100%;
}
th,
td {
text-align: left;
padding: 0.5rem;
}
td {
border-bottom: 1px solid hsl(0, 0%, 85%);
}
thead th {
border-bottom: 2px solid hsl(0, 0%, 70%);
}
tfoot th {
border-top: 2px solid hsl(0, 0%, 70%);
}
/* Center align the title */
h1:first-child {
text-align: center;
}
/* Nested ordered list for ToC */
nav ol {
counter-reset: item;
padding-left: 2rem;
}
nav li {
display: block;
}
nav li:before {
content: counters(item, ".") " ";
counter-increment: item;
padding-right: 0.85rem;
}
/* Center definitions (most useful for display equations) */
dl dd {
text-align: center;
}
/* Theorem */
.theorem {
counter-increment: theorem;
display: block;
margin: 12px 0;
font-style: italic;
}
.theorem::before {
content: "Theorem " counter(theorem) ". ";
font-weight: bold;
font-style: normal;
}
/* Lemma */
.lemma {
counter-increment: theorem;
display: block;
margin: 12px 0;
font-style: italic;
}
.lemma::before {
content: "Lemma " counter(theorem) ". ";
font-weight: bold;
font-style: normal;
}
/* Proof */
.proof {
display: block;
margin: 12px 0;
font-style: normal;
position: relative;
}
.proof::before {
content: "Proof." attr(title);
font-style: italic;
}
.proof:after {
content: "◾️";
position: absolute;
right: -12px;
bottom: -2px;
}
/* Definition */
.definition {
counter-increment: definition;
display: block;
margin: 12px 0;
font-style: normal;
}
.definition::before {
content: "Definition " counter(definition) ". ";
font-weight: bold;
font-style: normal;
}
/* Center align author name, use small caps and add vertical spacing */
.author {
margin: .85rem 0;
font-variant-caps: small-caps;
text-align: center;
}
/* Make footnote text smaller and left align it (looks bad with long URLs) */
.footnotes p {
text-align: left;
line-height: 1.5;
font-size: 85%;
margin-bottom: 0.4rem;
}
/* Center title and paragraph */
.abstract,
.abstract p {
text-align: center;
}
.abstract {
margin: 2.25rem 0;
}
/* Format the LaTeX symbol correctly (a higher up, e lower) */
.latex span:nth-child(1) {
text-transform: uppercase;
font-size: 0.75em;
vertical-align: 0.25em;
margin-left: -0.36em;
margin-right: -0.15em;
line-height: 1ex;
}
.latex span:nth-child(2) {
text-transform: uppercase;
vertical-align: -0.5ex;
margin-left: -0.1667em;
margin-right: -0.125em;
line-height: 1ex;
}
/* Heading typography */
h1 {
font-size: 2.5rem;
line-height: 3.25rem;
margin-bottom: 1.625rem;
}
h2 {
font-size: 1.7rem;
line-height: 2rem;
margin-top: 3rem;
}
h3 {
font-size: 1.4rem;
margin-top: 2.75rem;
}
h4 {
font-size: 1.2rem;
margin-top: 2.5rem;
}
h5 {
font-size: 1rem;
margin-top: 2.25rem;
}
h6 {
font-size: 1rem;
margin-top: 4rem;
}
h3,
h4,
h5,
h6 {
line-height: 1.625rem;
}
h1 + h2 {
margin-top: 1.625rem;
}
h2 + h3,
h3 + h4,
h4 + h5 {
margin-top: 0.8rem;
}
h5 + h6 {
margin-top: -0.8rem;
}
h2,
h3,
h4,
h5,
h6 {
margin-bottom: 0.8rem;
}
h6 {
font-style: italic;
font-weight: normal;
}