In addition to the color scheme changing based on the system setting, enable setting the color scheme explicitly by adding a color-scheme="light | dark" attribute on the <html> element. Doing this was a bit tricky. I originally implemented the grayscale ramp by reversing it when prefers-color-scheme: dark. This was convenient, but meant that setting the color scheme explicitly didn't work. Along the way I discovered the light-dark() CSS function. Deploy that as the preferred style if the browser supports it. Otherwise, fall back on the prefers-color-scheme media queries. This function only works if color-scheme: light dark is set on the :root element.
27 lines
433 B
CSS
27 lines
433 B
CSS
|
|
.main--single,
|
|
.main--list,
|
|
.content
|
|
{
|
|
blockquote,
|
|
dl,
|
|
ol,
|
|
ul,
|
|
.footnotes
|
|
{
|
|
grid-column: main-start / main-end;
|
|
}
|
|
|
|
.codeblock {
|
|
color: var(--foreground);
|
|
background-color: var(--background);
|
|
font-family: var(--font-family-monospace);
|
|
grid-column: gutter-start / gutter-end;
|
|
overflow: auto;
|
|
padding-block: var(--space-s);
|
|
|
|
.line {
|
|
margin-inline: var(--gutter-width);
|
|
}
|
|
}
|
|
}
|