Watch
1
0
Fork
You've already forked rgebee-info
0
rgebee-info/static/global.css
Chris Dill 5f47096d04
All checks were successful
Build / build (push) Successful in 18s
feat: Update content styling
2026-10-30 08:20:29 +00:00

443 lines
8.8 KiB
CSS
Executable file

:root {
color-scheme: dark;
--background-color: #16191d;
--surface-color: #1e2328;
--text-color: #e9e7e2;
--muted-color: #a8afb6;
--code-color: #e1e4e8;
--accent-color: #f0902f;
--link-color: #70b3ff;
--line-color: #3d444d;
--font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
--font-mono: ui-monospace, SFMono-Regular, Menlo, "Cascadia Code", Consolas, "Liberation Mono", monospace;
--content-width: 40rem;
--logo-gap: 1.25rem;
--logo-nav-gap: 1.5rem;
--gutter: clamp(1rem, 4vw, 1.5rem);
}
/* ==========================================================================
Base
========================================================================== */
*,
*::before,
*::after {
box-sizing: border-box;
}
html {
min-height: 100%;
scroll-behavior: smooth;
font-size: 100%;
-webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
html {
scroll-behavior: auto;
}
}
body {
margin: 0;
background-color: var(--background-color);
color: var(--text-color);
font-family: var(--font-sans);
line-height: 1.6;
}
.container {
width: min(100%, var(--content-width));
margin-inline: auto;
padding: var(--gutter);
}
/* adjacent containers (header + main + footer) shouldn't stack their padding */
header.container {
padding-top: 0.4rem;
padding-bottom: 0;
}
header + .container,
.container + .container {
padding-top: 0;
}
main {
font-size: 1.0625rem;
}
main img {
display: block;
max-width: 100%;
height: auto;
border-radius: 6px;
}
figure {
margin: 1.5rem 0;
}
figcaption {
margin-top: 0.5rem;
color: var(--muted-color);
font-size: 0.875rem;
}
/* ==========================================================================
Headings
========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: 2rem;
margin-bottom: 0.6rem;
color: var(--text-color);
font-weight: 700;
line-height: 1.2;
letter-spacing: -0.01em;
text-wrap: balance;
}
h1 {
font-size: 2rem;
}
h2 {
font-size: 1.5rem;
}
h3 {
font-size: 1.25rem;
}
h4 {
font-size: 1.1rem;
}
h5,
h6 {
font-size: 1rem;
}
small {
font-size: 0.875em;
color: var(--muted-color);
}
p {
margin-top: 0;
margin-bottom: 1.1rem;
text-wrap: pretty;
}
.title h1 {
margin: 0;
}
/* ==========================================================================
Links
========================================================================== */
a {
color: var(--link-color);
text-decoration-line: none;
text-decoration-thickness: 1px;
text-decoration-color: color-mix(in srgb, var(--link-color) 75%, transparent);
text-underline-offset: 0.2em;
}
a:hover {
text-decoration-line: underline;
text-decoration-thickness: 2px;
text-decoration-color: currentColor;
}
a:focus-visible {
outline: 2px solid var(--accent-color);
outline-offset: 3px;
border-radius: 2px;
}
/* ==========================================================================
Lists
========================================================================== */
main ul,
main ol {
margin: 0 0 1.1rem;
padding-left: 1.4rem;
list-style-position: outside;
}
main li + li {
margin-top: 0.35rem;
}
main li::marker {
color: var(--accent-color);
}
main ul ul,
main ol ol,
main ul ol,
main ol ul {
margin-top: 0.35rem;
margin-bottom: 0;
}
/* ==========================================================================
Rules, quotes, code, tables
========================================================================== */
hr {
margin: 2rem 0;
border: none;
border-top: 2px solid var(--line-color);
}
blockquote {
margin: 1.5rem 0;
padding: 0.25rem 0 0.25rem 1.1rem;
border-left: 4px solid var(--accent-color);
color: var(--muted-color);
font-style: italic;
}
blockquote p:last-child {
margin-bottom: 0;
}
code {
padding: 0.1em 0.35em;
border-radius: 4px;
background-color: var(--surface-color);
font-family: var(--font-mono);
font-size: 0.9em;
}
pre {
margin: 1.5rem 0;
padding: 1rem;
overflow-x: auto;
border: 1px solid var(--line-color);
border-radius: 6px;
background-color: var(--surface-color);
line-height: 1.5;
tab-size: 2;
}
pre code {
display: block;
padding: 0;
border-radius: 0;
background-color: transparent;
color: var(--code-color);
font-size: 0.875rem;
}
table {
display: block;
width: 100%;
max-width: 100%;
margin: 1.5rem 0;
overflow-x: auto;
border-collapse: collapse;
font-size: 0.95rem;
}
th,
td {
padding: 0.5rem 0.75rem;
border-bottom: 1px solid var(--line-color);
text-align: left;
}
th {
border-bottom-color: var(--accent-color);
font-weight: 700;
}
/* ==========================================================================
Header / nav / footer
========================================================================== */
nav ul {
display: flex;
flex-wrap: wrap;
gap: 0.25rem 1.5rem;
margin: 0;
padding: 0;
list-style: none;
}
nav li {
font-weight: 600;
}
nav a {
display: inline-block;
padding: 0.1rem 0;
}
footer {
display: flex;
justify-content: space-between;
gap: 1rem;
margin-block: 2.25rem 1.25rem;
color: var(--muted-color);
}
footer div {
width: 100%;
border-top: 3px solid var(--accent-color);
padding-top: 0.75rem;
}
/* ==========================================================================
Blog list
========================================================================== */
.blog-list {
display: flex;
flex-direction: column;
margin: 0 0 1rem;
padding: 0;
list-style: none;
}
.blog-item {
display: flex;
flex-wrap: wrap;
align-items: baseline;
justify-content: space-between;
gap: 0.15rem 1.5rem;
margin: 0;
padding: 0.55rem 0;
border-bottom: 2px solid var(--line-color);
}
.blog-item a {
font-size: 1.1rem;
font-weight: 600;
line-height: 1.35;
}
.blog-item-meta {
flex-shrink: 0;
color: var(--muted-color);
font-size: 0.875rem;
font-variant-numeric: tabular-nums;
}
/* ==========================================================================
Home page
========================================================================== */
.index-content .title {
display: flex;
align-items: center;
gap: 1rem;
/* space above (nav to logo) is slightly larger than below (logo to intro
text); the 0.1rem offsets the nav link's own vertical padding */
margin-top: calc(var(--logo-nav-gap) - 0.1rem);
margin-bottom: var(--logo-gap);
}
.index-content .title img {
width: 64px;
height: 64px;
border-radius: 8px;
}
.index-content h2 {
padding-top: 1.8rem;
border-top: 3px solid var(--accent-color);
}
/* ==========================================================================
Blog index & 404 page
========================================================================== */
.blog .title,
.error-404 {
/* heading above the rule, same 1.8rem spacings as the home page divider */
margin-top: 1.8rem;
margin-bottom: 0.6rem;
padding-bottom: 1.8rem;
border-bottom: 3px solid var(--accent-color);
}
.error-404 .title {
margin-bottom: 1.5rem;
}
/* ==========================================================================
Blog page
========================================================================== */
.blog-page-content .title {
display: flex;
flex-direction: column;
gap: 0.6rem;
/* same gap above the title as the blog index page */
margin-top: 1.8rem;
margin-bottom: 1.5rem;
padding-bottom: 1rem;
border-bottom: 3px solid var(--accent-color);
}
.blog-page-content .title h1 {
margin: 0;
padding-bottom: 0;
border-bottom: none;
font-weight: 700;
}
.blog-page-content .title span {
color: var(--muted-color);
font-size: 0.9rem;
}
/* in-post headings */
.blog-page-content h1,
.blog-page-content h2,
.blog-page-content h3,
.blog-page-content h4,
.blog-page-content h5,
.blog-page-content h6 {
margin: 1.25rem 0 0.5rem;
font-weight: 500;
}
/* headings get a subtle underline rule */
.blog-page-content h1,
.blog-page-content h2,
.blog-page-content h3,
.blog-page-content h4,
.blog-page-content h5 {
padding-bottom: 0.5rem;
border-bottom: 2px solid var(--line-color);
}
/* ==========================================================================
Post navigation
========================================================================== */
.post-nav {
display: flex;
justify-content: space-between;
gap: 1rem;
margin-top: 2rem;
padding-top: 0.75rem;
border-top: 2px solid var(--line-color);
font-size: 0.9375rem;
}
/* ==========================================================================
Small screens
========================================================================== */
@media (max-width: 30rem) {
main {
font-size: 1rem;
}
.blog-item {
flex-direction: column;
align-items: flex-start;
}
footer {
flex-direction: column;
}
}