120 lines
1.9 KiB
CSS

:root {
--clr-text: #ebdbb2;
--clr-brand: #fabd2f;
--clr-bg-0: #282828;
--clr-bg-1: #1d2021;
color-scheme: dark;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
*:focus-visible {
outline: 2px solid var(--clr-brand);
}
::selection {
background-color: var(--clr-text);
color: var(--clr-bg-0);
}
body {
font-family: system-ui;
background-color: var(--clr-bg-0);
color: var(--clr-text);
padding: 1rem;
max-width: 1000px;
margin: 0 auto;
line-height: 1.5;
}
h1, h2, h3, h4, h5, h6 {
line-height: 1;
code {
font-size: inherit;
}
}
a {
font-weight: bold;
color: inherit;
text-decoration-color: var(--clr-brand);
}
p code {
background-color: #1d2021;
padding: 0.25rem 0.5rem;
border-radius: 0.5rem;
font-size: 1rem;
}
pre code {
border-radius: 0.5rem;
font-size: 1rem;
}
h1, h2, h3, h4, h5, h6 {
isolation: isolate;
position: relative;
max-width: max-content;
background: var(--clr-bg-1);
border-radius: 0 0.5rem 0.5rem 0;
padding: 0.33em 0.5em;
&::before {
content: "";
position: absolute;
width: 3em;
top: 0;
bottom: 0;
left: -3em;
z-index: -1;
background: linear-gradient(to left, var(--clr-bg-1), transparent);
border-radius: 0.5rem 0 0 0.5rem;
}
}
h2 {
position: sticky;
top: 0;
z-index: 10;
}
table-of-contents h2 {
position: initial;
}
table-of-contents {
background: var(--clr-bg-1);
border-radius: 0.5rem;
padding: 1.5rem;
display: block;
max-width: max-content;
}
table-of-contents ul:first-of-type {
font-size: 1.1em;
padding-left: 1.5rem;
margin: 0;
}
table-of-contents li: {
margin-bottom: 0.25em;
}
table-of-contents h2 {
padding-inline: 0;
margin: 0;
&::before {
all: initial;
}
}
h3 {
font-size: 1.4em;
}