support images

This commit is contained in:
Oskar Wickström
2024-08-22 17:08:58 +02:00
parent dcba7ef18b
commit c88ee9ac50
5 changed files with 36 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
:root {
--font-family: "Fira Code", monospace;
--line-height: 1.25rem;
--border-thickness: 1.5px;
--border-thickness: 1px;
--bold-weight: 700;
font-family: var(--font-family);
@@ -41,7 +41,7 @@ body {
width: 100%;
margin: 0;
padding: var(--line-height) 2ch;
max-width: 80ch;
max-width: calc(min(80ch, round(down, 100%, 1ch)));
line-height: var(--line-height);
}
@@ -165,6 +165,23 @@ p {
hyphens: auto;
}
img {
--real-height: 100% / var(--ratio);
display: block;
width: 100%;
padding-bottom: calc(
round(
down,
var(--line-height) - (
var(--real-height) - round(down, var(--real-height), var(--line-height))
),
1px
)
);
object-fit: contain;
}
pre, code {
font-family: var(--font-family);
}