mylloon.fr/static/css/markdown.css

257 lines
4.6 KiB
CSS
Raw Normal View History

2024-11-06 15:33:09 +01:00
@media (prefers-color-scheme: light) {
:root {
--separator-color: #cccccc;
}
}
@media (prefers-color-scheme: dark) {
:root {
--separator-color: #414558;
}
}
/* Page */
html {
scroll-behavior: smooth;
}
/* Anchors */
main :is(h1, h2, h3, h4, h5, h6):hover a.anchor::before {
visibility: visible;
}
main a.anchor::before {
content: "#";
visibility: hidden;
padding-right: 0.1em;
}
main a.anchor {
text-decoration: none;
vertical-align: baseline;
}
/* Links in headers */
:is(h1, h2, h3, h4, h5, h6) a {
font-size: inherit;
}
/* Images */
main img {
display: block;
margin: auto;
}
/* Separators */
hr {
border: 0;
height: 1px;
background: var(--separator-color);
}
/* Quotes */
blockquote {
margin: 1em 0;
padding: 0.1em 10px;
border-left: 6px solid;
2024-12-15 19:59:53 +01:00
border-color: light-dark(#9852fa, #bd93f9);
background: light-dark(#d8d6d6, #273341);
2024-11-06 15:33:09 +01:00
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
}
/* Little snippet of code (not blocks) */
kbd,
code:not(.hljs):not(:has(svg)) {
2024-12-15 19:59:53 +01:00
background: light-dark(#eeeeee, #333333);
2024-11-06 15:33:09 +01:00
border-radius: 3px;
2024-12-15 19:59:53 +01:00
color: light-dark(#333333, #eeeeee);
2024-11-06 15:33:09 +01:00
box-shadow: 0 1px 1px black;
font-size: calc(var(--font-size) * 0.8);
padding: 2px 4px;
vertical-align: 1.5px;
}
/* Code blocks */
.hljs {
border-radius: 5px;
}
.hljs::-webkit-scrollbar {
width: 7px;
height: 9px;
background: var(--background);
}
.hljs::-webkit-scrollbar-thumb {
background-color: var(--font-color);
border-radius: 10px;
}
/* Marge for numbers */
.hljs-ln-n {
margin-right: 0.4em;
}
/* Numbers in codeblocks */
.hljs-ln-numbers {
text-align: right;
color: var(--font-color);
}
/* Fix scroll in codeblocks with line numbering */
table.hljs-ln {
overflow: hidden;
}
/* Background for copy code button */
.hljs-copy-button {
background-color: var(--background) !important;
}
/* Light theme for the copy code button */
@media (prefers-color-scheme: light) {
.hljs-copy-button {
background-color: var(--font-color) !important;
filter: invert(100%);
}
}
/* Hide last line in codeblocks if empty */
.hljs-ln
> tbody
> tr:last-child:has(td:last-child > span::-moz-only-whitespace) {
visibility: collapse;
}
/* Temporary fix for layout.css.has-selector.enabled available only on
* Firefox under certain circumstances */
.hljs-ln > tbody > tr:last-child {
visibility: collapse;
}
/* Reference to footnotes */
.footnote-ref a {
text-decoration: underline dotted;
font-size: calc(var(--font-size) * 0.8);
}
/* Footnote */
section.footnotes * {
font-size: calc(var(--font-size) * 0.8);
}
2024-12-15 20:02:23 +01:00
/* Hightlight footnote on click */
2024-12-15 20:02:08 +01:00
section.footnotes :target {
background-color: light-dark(#fafa35b9, #adad213c);
}
2024-12-15 19:36:52 +01:00
2024-11-06 15:33:09 +01:00
/* When multiple ref */
a.footnote-backref sup {
font-size: calc(var(--font-size) * 0.6);
}
a.footnote-backref sup::before {
content: "(";
}
a.footnote-backref sup::after {
content: ")";
}
/* Footnotes links */
a.footnote-backref {
font-family: "Segoe UI", "Segoe UI Symbol", system-ui;
text-decoration: underline dotted;
}
/* Footnotes block separation from content */
section.footnotes {
margin: 3px;
border-top: 2px dotted var(--separator-color);
}
/* Mermaid diagrams */
pre:has(code.language-mermaid) {
text-align: center;
}
2024-11-06 15:46:27 +01:00
/* Tables */
2024-11-06 18:24:49 +01:00
table:not(.hljs-ln) {
2024-11-06 15:46:27 +01:00
border-collapse: collapse;
2024-11-06 17:41:27 +01:00
margin-inline: auto;
2024-11-06 15:46:27 +01:00
}
2024-11-06 18:24:49 +01:00
table:not(.hljs-ln) th,
table:not(.hljs-ln) td {
2024-11-06 15:46:27 +01:00
padding: 5px;
border: 1px solid var(--separator-color);
}
2024-11-06 18:24:49 +01:00
table:not(.hljs-ln)th {
2024-11-06 16:32:19 +01:00
border-bottom: 2px solid var(--separator-color);
}
2024-11-06 15:46:27 +01:00
/* No borders on the outer edges of the table */
2024-11-06 18:24:49 +01:00
table:not(.hljs-ln) tr:last-child td {
2024-11-06 15:46:27 +01:00
border-bottom: 0;
}
2024-11-06 18:24:49 +01:00
table:not(.hljs-ln) tr:first-child th {
2024-11-06 15:46:27 +01:00
border-top: 0;
}
2024-11-06 18:24:49 +01:00
table:not(.hljs-ln) tr td:first-child,
table:not(.hljs-ln) tr th:first-child {
2024-11-06 15:46:27 +01:00
border-left: 0;
}
2024-11-06 18:24:49 +01:00
table:not(.hljs-ln) tr td:last-child,
table:not(.hljs-ln) tr th:last-child {
2024-11-06 15:46:27 +01:00
border-right: 0;
}
2024-11-06 15:33:09 +01:00
@media print {
/* Better colors for paper */
blockquote {
border-color: black;
background: var(--background);
}
.hljs {
background: var(--background);
}
/* Force line numbering to be on top */
td.hljs-ln-line {
vertical-align: top;
}
/* Break code */
code.hljs {
white-space: break-spaces;
hyphens: none;
}
/* Hide arrows of backref */
a.footnote-backref {
visibility: hidden;
}
/* No underline for footnotes */
.footnote-ref > a {
text-decoration: none;
}
2024-11-17 19:03:49 +01:00
/* Prevent figures from splitting accross pages */
article *:has(img),
table:not(.hljs-ln),
table:not(.hljs-ln) > * {
page-break-inside: avoid;
}
2024-11-18 01:59:32 +01:00
@page {
@bottom-right {
content: counter(page) "/" counter(pages);
}
}
2024-11-06 15:33:09 +01:00
}