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

269 lines
4.7 KiB
CSS
Raw Normal View History

2023-04-19 18:55:03 +02:00
@media (prefers-color-scheme: light) {
:root {
--selection: rgba(92, 54, 131, 0.7);
2023-04-24 20:59:02 +02:00
--bg: #ffffff;
--font-color: #18181b;
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 02:45:42 +02:00
--link-hover-color: #fd62af;
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 {
--selection: rgba(124, 75, 173, 0.5);
2023-04-24 20:59:02 +02:00
--bg: #171e26;
--font-color: #bcbcc5;
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 02:45:42 +02:00
--link-hover-color: #ff80bf;
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 {
--font-size: 17px;
--max-width: 750px;
2023-04-19 18:55:03 +02:00
}
html {
2023-04-24 18:09:14 +02:00
font-family: "Segoe UI", Arial, sans-serif, "Segoe UI Emoji",
"Segoe UI Symbol";
2023-04-19 18:55:03 +02:00
font-size: var(--font-size);
2023-04-24 18:09:14 +02:00
scroll-behavior: smooth;
2023-04-24 20:59:02 +02:00
background-color: var(--bg);
2023-04-28 14:21:48 +02:00
line-height: 1.5;
2023-04-19 18:55:03 +02:00
}
2023-04-27 09:00:45 +02:00
/* Scrollbar - Firefox */
2023-04-27 09:00:22 +02:00
* {
scrollbar-color: var(--font-color) var(--bg);
}
2023-04-27 09:00:45 +02:00
/* Scrollbar - Chrome */
2023-04-27 09:00:22 +02:00
*::-webkit-scrollbar {
width: 7px;
height: 9px;
background: var(--bg);
}
*::-webkit-scrollbar-thumb {
background-color: var(--font-color);
border-radius: 10px;
}
2023-04-25 03:29:55 +02:00
/* Post's title */
header > h1 {
font-size: 2.5rem;
}
/* Date's title */
2023-05-02 16:02:50 +02:00
header > span {
2023-04-25 03:29:55 +02:00
font-style: italic;
}
2023-05-02 16:11:09 +02:00
/* Tags */
header > ul {
display: inline;
margin-left: 1em;
padding: 0;
}
header li::before {
content: "#";
}
header li {
display: inline;
background-color: var(--tag-bg-color);
border-radius: 5px;
padding: 2px 8px;
font-size: calc(var(--font-size) / 1.1);
}
2023-04-19 18:55:03 +02:00
::selection {
color: rgb(255, 255, 255);
background: var(--selection);
}
2023-04-24 20:59:02 +02:00
2023-04-25 02:32:32 +02:00
* {
color: var(--font-color);
2023-05-02 15:14:51 +02:00
outline: none;
2023-04-25 02:32:32 +02:00
}
p {
color: var(--font-color);
font-size: var(--font-size);
}
2023-04-24 20:59:02 +02:00
/* Anchors */
h1:hover > a.anchor::before,
h2:hover > a.anchor::before,
h3:hover > a.anchor::before,
h4:hover > a.anchor::before,
h5:hover > a.anchor::before,
h6:hover > a.anchor::before {
2023-04-24 20:59:02 +02:00
visibility: visible;
2023-04-25 02:45:42 +02:00
color: var(--font-color);
2023-04-24 20:59:02 +02:00
}
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;
}
body {
margin: 0 auto;
2023-04-27 01:06:05 +02:00
max-width: var(--max-width);
2023-04-24 20:59:02 +02:00
}
footer {
text-align: center;
}
2023-04-25 02:45:42 +02:00
footer > * {
text-transform: uppercase;
font-size: calc(var(--font-size) / 1.2);
letter-spacing: 0.15rem;
opacity: 0.6;
text-decoration: none;
2023-04-25 03:21:05 +02:00
padding-bottom: 1em;
2023-04-25 02:45:42 +02:00
}
a:hover {
color: var(--link-hover-color);
}
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-color: 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: Consolas, monospace;
}
2023-04-25 03:21:05 +02:00
/* Little snippet of code (not blocks) */
kbd,
code:not(.hljs):not(:has(svg)) {
background-color: var(--code-bg-color);
border-radius: 3px;
color: var(--code-font-color);
2023-04-25 13:44:27 +02:00
box-shadow: 0 1px 1px black;
2023-04-25 03:21:05 +02:00
font-size: calc(var(--font-size) / 1.2);
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
margin-inline: 0.4em; /* Marge for numbers */
border-radius: 5px;
2023-04-24 20:59:02 +02:00
}
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;
}
/* 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(--bg) !important;
}
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;
}
2023-04-25 02:32:32 +02:00
/* Footnotes */
2023-04-24 23:01:44 +02:00
.footnotes a {
font-family: "Segoe UI";
text-decoration: underline dotted;
}
2023-04-25 02:32:32 +02:00
/* Reference to footnotes */
2023-04-24 23:01:44 +02:00
.footnote-ref > a {
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
@media only screen and (max-width: 750px) {
2023-04-25 13:44:47 +02:00
body {
margin: 20px;
}
}
2023-05-02 23:10:36 +02:00
/* Table of content */
nav#toc {
position: fixed;
top: 0;
left: 25px;
margin-left: 50px;
}
@media only screen and (max-width: 1500px) {
/* Visible only on large screens */
nav#toc {
visibility: hidden;
}
}