refactor: simplify css tokens

This commit is contained in:
2026-06-22 20:57:06 +00:00
parent 39700ad953
commit 78d6701d7d
+74 -81
View File
@@ -1,26 +1,27 @@
@layer tokens { @layer tokens {
:root { :root {
--color-surface-rgb: 22 20 19; --surface: rgb(22 20 19);
--color-surface-container-lowest-rgb: 12 11 10; --surface-low: rgb(29 26 25);
--color-surface-container-low-rgb: 29 26 25; --surface-lowest-soft: rgb(12 11 10 / 0.95);
--color-on-surface-rgb: 234 228 226; --surface-backdrop: rgb(12 11 10 / 0.86);
--color-on-surface-variant-rgb: 210 199 197;
--color-primary-rgb: 209 140 129;
--color-primary-container-rgb: 91 44 35;
--color-on-primary-container-rgb: 255 218 207;
--color-outline-rgb: 150 141 138;
--surface: rgb(var(--color-surface-rgb)); --text: rgb(234 228 226);
--surface-lowest: rgb(var(--color-surface-container-lowest-rgb)); --text-soft: rgb(234 228 226 / 0.9);
--surface-low: rgb(var(--color-surface-container-low-rgb)); --text-muted: rgb(210 199 197);
--on-surface: rgb(var(--color-on-surface-rgb)); --text-muted-soft: rgb(210 199 197 / 0.7);
--on-surface-muted: rgb(var(--color-on-surface-rgb) / 0.9); --text-muted-faint: rgb(210 199 197 / 0.6);
--on-surface-variant: rgb(var(--color-on-surface-variant-rgb)); --text-underline: rgb(234 228 226 / 0.35);
--primary: rgb(var(--color-primary-rgb));
--primary-container: rgb(var(--color-primary-container-rgb)); --primary: rgb(209 140 129);
--on-primary-container: rgb(var(--color-on-primary-container-rgb)); --primary-soft: rgb(209 140 129 / 0.65);
--hairline: rgb(var(--color-on-surface-rgb) / 0.1); --primary-container: rgb(91 44 35);
--outline-soft: rgb(var(--color-outline-rgb) / 0.3); --on-primary-container: rgb(255 218 207);
--line: rgb(234 228 226 / 0.1);
--line-soft: rgb(234 228 226 / 0.12);
--line-strong: rgb(234 228 226 / 0.18);
--checkbox-border: rgb(234 228 226 / 0.45);
--outline: rgb(150 141 138 / 0.3);
--font-body: "JetBrains Mono", monospace; --font-body: "JetBrains Mono", monospace;
--font-display: "Cormorant Garamond", serif; --font-display: "Cormorant Garamond", serif;
@@ -61,7 +62,7 @@
margin: 0; margin: 0;
display: flex; display: flex;
background: var(--surface); background: var(--surface);
color: var(--on-surface); color: var(--text);
font: var(--text-body); font: var(--text-body);
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
@@ -119,13 +120,13 @@
flex-direction: column; flex-direction: column;
gap: var(--space-12); gap: var(--space-12);
padding-right: var(--space-8); padding-right: var(--space-8);
border-right: 1px solid var(--hairline); border-right: 1px solid var(--line);
color: var(--on-surface-variant); color: var(--text-muted);
} }
.site-title { .site-title {
display: block; display: block;
color: var(--on-surface); color: var(--text);
font: var(--text-display); font: var(--text-display);
} }
@@ -140,14 +141,10 @@
@layer components { @layer components {
.content { .content {
max-width: none; max-width: none;
color: var(--on-surface-muted); color: var(--text-soft);
overflow-wrap: break-word; overflow-wrap: break-word;
} }
.content > * + * {
margin-top: var(--space-6);
}
.page-actions { .page-actions {
margin-top: var(--space-12); margin-top: var(--space-12);
} }
@@ -156,7 +153,7 @@
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
margin-bottom: var(--space-4); margin-bottom: var(--space-4);
color: var(--on-surface-variant); color: var(--text-muted);
font-style: italic; font-style: italic;
transition: color 150ms ease; transition: color 150ms ease;
} }
@@ -172,7 +169,7 @@
.rule { .rule {
border: 0; border: 0;
border-top: 1px solid var(--hairline); border-top: 1px solid var(--line);
} }
.page-list { .page-list {
@@ -184,7 +181,7 @@
} }
.page-list article + article { .page-list article + article {
border-top: 1px solid var(--hairline); border-top: 1px solid var(--line);
} }
.entry-title { .entry-title {
@@ -203,11 +200,11 @@
.entry-summary { .entry-summary {
margin: 0; margin: 0;
color: var(--on-surface-muted); color: var(--text-soft);
} }
.footer-note { .footer-note {
color: var(--on-surface-variant); color: var(--text-muted);
font: 400 18px / 28px var(--font-display); font: 400 18px / 28px var(--font-display);
font-style: italic; font-style: italic;
} }
@@ -225,10 +222,10 @@
position: relative; position: relative;
width: 100%; width: 100%;
padding: 0.375rem var(--space-3) 0.375rem var(--space-8); padding: 0.375rem var(--space-3) 0.375rem var(--space-8);
border: 1px solid var(--outline-soft); border: 1px solid var(--outline);
border-radius: var(--radius-sm); border-radius: var(--radius-sm);
background: transparent; background: transparent;
color: var(--on-surface); color: var(--text);
text-align: left; text-align: left;
font-size: 13px; font-size: 13px;
transition: border-color 150ms ease, box-shadow 150ms ease; transition: border-color 150ms ease, box-shadow 150ms ease;
@@ -246,12 +243,12 @@
position: absolute; position: absolute;
left: var(--space-2); left: var(--space-2);
top: 0.375rem; top: 0.375rem;
color: var(--on-surface-variant); color: var(--text-muted);
font-size: 18px; font-size: 18px;
} }
.search-trigger-label { .search-trigger-label {
color: rgb(var(--color-on-surface-variant-rgb) / 0.7); color: var(--text-muted-soft);
} }
.tree-node { .tree-node {
@@ -264,7 +261,7 @@
align-items: center; align-items: center;
width: 100%; width: 100%;
padding-block: var(--space-1); padding-block: var(--space-1);
color: var(--on-surface-variant); color: var(--text-muted);
text-align: left; text-align: left;
transition: color 150ms ease; transition: color 150ms ease;
} }
@@ -275,7 +272,7 @@
} }
.tree-link--section { .tree-link--section {
color: var(--on-surface); color: var(--text);
} }
.tree-link--nested { .tree-link--nested {
@@ -283,7 +280,7 @@
} }
.tree-link--nested:hover { .tree-link--nested:hover {
color: var(--on-surface); color: var(--text);
} }
.tree-link--leaf { .tree-link--leaf {
@@ -293,7 +290,7 @@
} }
.tree-link--leaf:hover { .tree-link--leaf:hover {
color: var(--on-surface); color: var(--text);
} }
.tree-link--current { .tree-link--current {
@@ -302,7 +299,7 @@
.tree-icon { .tree-icon {
margin-right: var(--space-1); margin-right: var(--space-1);
color: var(--on-surface-variant); color: var(--text-muted);
font-size: 16px; font-size: 16px;
transition: color 150ms ease; transition: color 150ms ease;
} }
@@ -317,7 +314,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: var(--space-1); gap: var(--space-1);
color: var(--on-surface-variant); color: var(--text-muted);
font-size: 13px; font-size: 13px;
} }
@@ -334,7 +331,7 @@
top: 0; top: 0;
bottom: 0; bottom: 0;
width: 1px; width: 1px;
background: var(--hairline); background: var(--line);
} }
.search-dialog { .search-dialog {
@@ -344,11 +341,11 @@
padding: 0; padding: 0;
border: 0; border: 0;
background: transparent; background: transparent;
color: var(--on-surface); color: var(--text);
} }
.search-dialog::backdrop { .search-dialog::backdrop {
background: rgb(var(--color-surface-container-lowest-rgb) / 0.86); background: var(--surface-backdrop);
} }
.search-stack { .search-stack {
@@ -365,22 +362,22 @@
position: absolute; position: absolute;
left: var(--space-3); left: var(--space-3);
top: 0.625rem; top: 0.625rem;
color: var(--on-surface-variant); color: var(--text-muted);
font-size: 20px; font-size: 20px;
} }
.search-input { .search-input {
width: 100%; width: 100%;
padding: 0.625rem var(--space-12) 0.625rem 2.5rem; padding: 0.625rem var(--space-12) 0.625rem 2.5rem;
border: 1px solid var(--outline-soft); border: 1px solid var(--outline);
border-radius: var(--radius-sm); border-radius: var(--radius-sm);
background: rgb(var(--color-surface-container-lowest-rgb) / 0.95); background: var(--surface-lowest-soft);
color: var(--on-surface); color: var(--text);
transition: border-color 150ms ease, box-shadow 150ms ease; transition: border-color 150ms ease, box-shadow 150ms ease;
} }
.search-input::placeholder { .search-input::placeholder {
color: rgb(var(--color-on-surface-variant-rgb) / 0.6); color: var(--text-muted-faint);
} }
.search-close { .search-close {
@@ -395,11 +392,11 @@
border: 0; border: 0;
border-radius: var(--radius-sm); border-radius: var(--radius-sm);
background: transparent; background: transparent;
color: var(--on-surface-variant); color: var(--text-muted);
} }
.search-close:hover { .search-close:hover {
color: var(--on-surface); color: var(--text);
} }
.search-close .material-symbols-outlined { .search-close .material-symbols-outlined {
@@ -411,14 +408,14 @@
min-height: 28rem; min-height: 28rem;
max-height: 70vh; max-height: 70vh;
overflow: hidden; overflow: hidden;
border: 1px solid var(--outline-soft); border: 1px solid var(--outline);
border-radius: var(--radius-sm); border-radius: var(--radius-sm);
background: rgb(var(--color-surface-container-lowest-rgb) / 0.95); background: var(--surface-lowest-soft);
} }
.search-results { .search-results {
overflow-y: auto; overflow-y: auto;
border-bottom: 1px solid var(--outline-soft); border-bottom: 1px solid var(--outline);
} }
.search-preview { .search-preview {
@@ -432,13 +429,13 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: var(--space-6); padding: var(--space-6);
color: var(--on-surface-variant); color: var(--text-muted);
text-align: center; text-align: center;
} }
.search-placeholder { .search-placeholder {
margin: 0; margin: 0;
color: var(--on-surface-variant); color: var(--text-muted);
} }
.search-mark { .search-mark {
@@ -450,7 +447,7 @@
.search-preview-title { .search-preview-title {
display: block; display: block;
color: var(--on-surface); color: var(--text);
font: var(--text-headline); font: var(--text-headline);
transition: color 150ms ease; transition: color 150ms ease;
} }
@@ -461,20 +458,20 @@
.search-preview-summary { .search-preview-summary {
margin: var(--space-4) 0 0; margin: var(--space-4) 0 0;
color: var(--on-surface-muted); color: var(--text-soft);
} }
.search-preview-body { .search-preview-body {
margin: var(--space-6) 0 0; margin: var(--space-6) 0 0;
color: var(--on-surface-variant); color: var(--text-muted);
white-space: pre-wrap; white-space: pre-wrap;
} }
.search-result { .search-result {
display: block; display: block;
padding: var(--space-3) var(--space-4); padding: var(--space-3) var(--space-4);
border-bottom: 1px solid var(--outline-soft); border-bottom: 1px solid var(--outline);
color: var(--on-surface); color: var(--text);
} }
.search-result:hover, .search-result:hover,
@@ -486,14 +483,14 @@
@layer prose { @layer prose {
.content :where(h1, h2, h3, h4) { .content :where(h1, h2, h3, h4) {
color: var(--on-surface); color: var(--text);
font-family: var(--font-display); font-family: var(--font-display);
font-weight: 400; font-weight: 400;
} }
.content :where(h1, h2) { .content :where(h1, h2) {
text-decoration: underline; text-decoration: underline;
text-decoration-color: rgb(var(--color-on-surface-rgb) / 0.35); text-decoration-color: var(--text-underline);
text-decoration-thickness: 1px; text-decoration-thickness: 1px;
text-underline-offset: 0.18em; text-underline-offset: 0.18em;
} }
@@ -547,7 +544,7 @@
} }
.content li::marker { .content li::marker {
color: var(--on-surface-muted); color: var(--text-soft);
} }
.content li > p { .content li > p {
@@ -559,7 +556,7 @@
} }
.content strong { .content strong {
color: var(--on-surface); color: var(--text);
font-weight: 700; font-weight: 700;
} }
@@ -572,8 +569,8 @@
.content blockquote { .content blockquote {
margin-inline: 2ch 0; margin-inline: 2ch 0;
padding-left: 2ch; padding-left: 2ch;
border-left: 2px solid rgb(var(--color-primary-rgb) / 0.65); border-left: 2px solid var(--primary-soft);
color: var(--on-surface-variant); color: var(--text-muted);
font-style: italic; font-style: italic;
} }
@@ -596,19 +593,19 @@
.content th, .content th,
.content td { .content td {
padding: var(--space-2) var(--space-3); padding: var(--space-2) var(--space-3);
border: 1px solid rgb(var(--color-on-surface-rgb) / 0.12); border: 1px solid var(--line-soft);
text-align: left; text-align: left;
} }
.content th { .content th {
border-color: rgb(var(--color-on-surface-rgb) / 0.18); border-color: var(--line-strong);
color: var(--on-surface); color: var(--text);
font-weight: 700; font-weight: 700;
} }
.content hr { .content hr {
border: 0; border: 0;
border-top: 1px solid var(--hairline); border-top: 1px solid var(--line);
} }
.content input[type="checkbox"] { .content input[type="checkbox"] {
@@ -616,14 +613,10 @@
width: 0.875rem; width: 0.875rem;
height: 0.875rem; height: 0.875rem;
margin: 0 0.5rem 0 0; margin: 0 0.5rem 0 0;
display: inline-grid;
place-content: center;
vertical-align: -0.125rem; vertical-align: -0.125rem;
accent-color: var(--primary);
background-color: var(--surface); background-color: var(--surface);
border: 1px solid rgb(var(--color-on-surface-rgb) / 0.45); border: 1px solid var(--checkbox-border);
border-radius: 0.125rem; border-radius: 0.125rem;
border-color: rgb(var(--color-on-surface-rgb) / 0.45);
color: var(--primary); color: var(--primary);
} }
@@ -644,7 +637,7 @@
} }
.search-results { .search-results {
border-right: 1px solid var(--outline-soft); border-right: 1px solid var(--outline);
border-bottom: 0; border-bottom: 0;
} }
@@ -669,7 +662,7 @@
padding-right: 0; padding-right: 0;
padding-bottom: var(--space-8); padding-bottom: var(--space-8);
border-right: 0; border-right: 0;
border-bottom: 1px solid var(--hairline); border-bottom: 1px solid var(--line);
} }
.site-main { .site-main {