hugo-theme-termlite/assets/css/099_page_header.css
Eryn Wells 8a00cc6de9 Colors: Allow setting the color scheme explicitly
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.
2024-07-27 23:01:31 -07:00

39 lines
803 B
CSS

.page-header {
font-family: var(--font-family-monospace);
grid-column: main-start / main-end;
margin-block: var(--space-xl) var(--space-l);
/* margin-block-start is set by the grid */
&:first-child,
.page-header__title:first-child
{
margin-block-start: 0;
}
:last-child {
margin-block-end: 0;
}
.page-header__title {
font-family: var(--font-family-monospace);
font-size: var(--text-xxl);
line-height: 1.2;
margin-block: var(--space-xs);
&:only-child {
margin-block-end: 0;
}
}
.page-header__subtitle {
color: var(--text-color-secondary);
font-size: var(--text-m);
}
.page-date {
display: block;
font-family: var(--font-family-body);
font-size: var(--text-s);
margin-block: var(--space-paragraph) 0;
}
}