mylloon.fr/static/css/blog/post.css

227 lines
3.9 KiB
CSS
Raw Normal View History

2023-04-19 18:55:03 +02:00
@media (prefers-color-scheme: light) {
:root {
2023-04-24 23:01:44 +02:00
--code-font-color: #333333;
--code-bg-color: #eeeeee;
2023-04-25 02:32:32 +02:00
--quote-border-color: #9852fa;
--quote-bg-color: #d8d6d6;
2023-04-25 13:44:27 +02:00
--separator-color: #cccccc;
2023-05-02 16:11:09 +02:00
--tag-bg-color: #d2e0f0;
2023-04-19 18:55:03 +02:00
}
}
@media (prefers-color-scheme: dark) {
:root {
2023-04-24 23:01:44 +02:00
--code-font-color: #eeeeee;
--code-bg-color: #333333;
2023-04-25 02:32:32 +02:00
--quote-border-color: #bd93f9;
--quote-bg-color: #273341;
2023-04-25 13:44:27 +02:00
--separator-color: #414558;
2023-05-02 16:11:09 +02:00
--tag-bg-color: #242e38;
2023-04-19 18:55:03 +02:00
}
}
:root {
--max-width: 750px;
2023-04-19 18:55:03 +02:00
}
/* Page */
2023-04-19 18:55:03 +02:00
html {
2023-04-24 18:09:14 +02:00
scroll-behavior: smooth;
2023-04-19 18:55:03 +02:00
}
body {
max-width: var(--max-width);
margin: auto;
2023-04-27 09:00:22 +02:00
}
/* Post title */
header h1 {
font-size: calc(var(--font-size) * 2);
2023-04-25 03:29:55 +02:00
}
/* Post date */
header span {
2023-04-25 03:29:55 +02:00
font-style: italic;
}
/* Post tags */
header > ul:last-of-type {
2023-05-02 16:11:09 +02:00
display: inline;
margin-left: 1em;
padding: 0;
}
header > ul:last-of-type li::before {
2023-05-02 16:11:09 +02:00
content: "#";
}
header > ul:last-of-type li {
2023-05-02 16:11:09 +02:00
display: inline;
background: var(--tag-bg-color);
2023-05-02 16:11:09 +02:00
border-radius: 5px;
padding: 2px 8px;
font-size: calc(var(--font-size) * 0.9);
2023-04-19 18:55:03 +02:00
}
2023-04-24 20:59:02 +02:00
/* Post */
main {
margin: 0;
2023-12-25 19:50:51 +01:00
padding-block: 0;
max-width: 100%;
2023-04-25 02:32:32 +02:00
}
2023-04-24 20:59:02 +02:00
/* Anchors */
:is(h1, h2, h3, h4, h5, h6):hover a.anchor::before {
2023-04-24 20:59:02 +02:00
visibility: visible;
}
a.anchor::before {
2023-04-24 20:59:02 +02:00
content: "#";
visibility: hidden;
padding-right: 0.1em;
}
a.anchor {
2023-04-24 20:59:02 +02:00
text-decoration: none;
vertical-align: baseline;
2023-04-24 20:59:02 +02:00
}
/* Links in headers */
:is(h1, h2, h3, h4, h5, h6) a {
font-size: inherit;
2023-04-25 02:45:42 +02:00
}
/* Separators */
2023-04-25 03:21:05 +02:00
hr {
border: 0;
height: 1px;
2023-04-25 13:44:27 +02:00
background: var(--separator-color);
2023-04-25 03:21:05 +02:00
}
/* Quotes */
blockquote {
margin: 1em 0;
padding: 0.1em 10px;
border-left: 6px solid;
border-color: var(--quote-border-color);
background: var(--quote-bg-color);
2023-04-27 19:17:51 +02:00
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
2023-04-25 03:21:05 +02:00
}
/* Images */
img {
display: block;
margin: auto;
2023-04-27 01:06:05 +02:00
max-width: var(--max-width);
2023-04-25 03:21:05 +02:00
}
2023-04-25 03:37:13 +02:00
/* Code */
kbd,
code {
font-family: monospace;
2023-04-25 03:37:13 +02:00
}
2023-04-25 03:21:05 +02:00
/* Little snippet of code (not blocks) */
kbd,
code:not(.hljs):not(:has(svg)) {
background: var(--code-bg-color);
2023-04-25 03:21:05 +02:00
border-radius: 3px;
color: var(--code-font-color);
2023-04-25 13:44:27 +02:00
box-shadow: 0 1px 1px black;
font-size: calc(var(--font-size) * 0.8);
2023-04-25 03:21:05 +02:00
padding: 2px 4px;
vertical-align: 1.5px;
}
2023-04-27 19:17:51 +02:00
/* Code blocks */
2023-04-24 20:59:02 +02:00
.hljs {
2023-04-27 19:17:51 +02:00
border-radius: 5px;
2023-04-24 20:59:02 +02:00
}
.hljs::-webkit-scrollbar {
width: 7px;
height: 9px;
background: var(--background);
}
.hljs::-webkit-scrollbar-thumb {
background-color: var(--font-color);
border-radius: 10px;
}
2023-05-03 21:26:15 +02:00
/* Marge for numbers */
.hljs-ln-n {
margin-right: 0.4em;
}
2023-04-25 02:32:32 +02:00
/* Numbers in codeblocks */
2023-04-24 20:59:02 +02:00
.hljs-ln-numbers {
text-align: right;
color: var(--font-color);
2023-04-24 20:59:02 +02:00
}
/* Fix scroll in codeblocks with line numbering */
table.hljs-ln {
overflow: hidden;
}
2023-04-25 03:21:05 +02:00
2023-04-27 20:36:02 +02:00
/* Background for copy code button */
.hljs-copy-button {
background-color: var(--background) !important;
2023-04-27 20:36:02 +02:00
}
2023-04-25 13:44:33 +02:00
/* Light theme for the copy code button */
@media (prefers-color-scheme: light) {
.hljs-copy-button {
2023-04-27 20:36:02 +02:00
background-color: var(--font-color) !important;
filter: invert(100%);
}
}
2023-04-25 13:44:33 +02:00
/* Hide last line in codeblocks if empty */
2023-04-24 20:59:02 +02:00
.hljs-ln
> tbody
2023-04-25 02:32:32 +02:00
> tr:last-child:has(td:last-child > span::-moz-only-whitespace) {
2023-04-24 20:59:02 +02:00
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 {
2023-04-24 23:01:44 +02:00
text-decoration: underline dotted;
font-size: calc(var(--font-size) * 0.8);
2023-04-24 23:01:44 +02:00
}
/* Footnotes */
.footnotes a {
2023-10-16 09:49:05 +02:00
font-family: "Segoe UI", "Segoe UI Symbol", system-ui;
2023-04-24 23:01:44 +02:00
text-decoration: underline dotted;
}
2023-04-25 02:32:32 +02:00
/* Mermaid diagrams */
pre:has(code.language-mermaid) {
text-align: center;
}
2023-04-25 13:44:47 +02:00
2023-05-02 23:10:36 +02:00
/* Table of content */
nav#toc {
position: fixed;
top: 0;
left: 25px;
margin-left: 50px;
}
/* breakpoint */
2023-05-02 23:10:36 +02:00
@media only screen and (max-width: 1500px) {
/* Visible only on large screens */
nav#toc {
visibility: hidden;
}
}