style code block filenames

This commit is contained in:
Joshua Seigler 2025-06-15 16:56:49 -04:00
parent 510a49ec0e
commit 2f85867a05
3 changed files with 44 additions and 9 deletions

View file

@ -6,7 +6,7 @@ pre[class*="language-"] {
word-spacing: normal;
word-break: normal;
word-wrap: normal;
font-size: 1em;
font-size: 0.8rem;
line-height: 1.5em;
color: var(--c-text-dim);
-moz-tab-size: 4;
@ -30,6 +30,15 @@ pre[class*="language-"] {
margin: 0.5em 0;
padding: 1.25em 1em;
}
p:has(+ pre[class*="language-"]) > code {
margin: 0;
padding: 0.1em 1em;
border-radius: none;
background: none;
}
p:has(>code) + pre[class*="language-"] {
margin-top: 0;
}
[class*="language-"] .namespace {
opacity: 0.7;
}

View file

@ -246,9 +246,9 @@ ul.collection {
}
p {
margin: 0;
+ p {
margin-top: 1lh;
}
}
p + p, pre + p {
margin-top: 1lh;
}
blockquote {
position: relative;
@ -485,6 +485,30 @@ h1 {
}
}
@media screen {
p:has(+ pre[class*="language-"] > code) {
position: relative;
font-size: 0.8em;
}
p:has(+ pre[class*="language-"]) > code::after {
content: "";
pointer-events: none;
opacity: 0.5;
position: absolute;
z-index: -1;
bottom: 0;
left: -2rem;
height: 4rem;
width: 20rem;
max-width: 100%;
background: radial-gradient(
ellipse farthest-side at 50% 100%,
var(--c-highlight),
transparent
);
}
}
main {
h1,
h2,