switched theme

This commit is contained in:
2026-04-02 13:14:18 +03:00
parent 0c26d89eae
commit e31dbbb16c
192 changed files with 215173 additions and 1463 deletions
+174
View File
@@ -0,0 +1,174 @@
// 404 Terminal Page
// Scoped custom properties switch with html.dark
.term-window {
// Dark mode values (default — site defaults to dark)
--tw-bg: #0d0d0d;
--tw-bar: #1c1c1c;
--tw-border: #2a2a2a;
--tw-text: #cdd6f4;
--tw-prompt: #10b981;
--tw-error: #f38ba8;
--tw-muted: #6c7086;
--tw-link: #89b4fa;
--tw-cursor: #10b981;
}
html:not(.dark) .term-window {
// Light mode: Catppuccin Latte palette
--tw-bg: #eff1f5;
--tw-bar: #e6e9ef;
--tw-border: #ccd0da;
--tw-text: #4c4f69;
--tw-prompt: #40a02b;
--tw-error: #d20f39;
--tw-muted: #7c7f93;
--tw-link: #1e66f5;
--tw-cursor: #40a02b;
}
.notfound-wrap {
min-height: 70dvh;
display: flex;
align-items: center;
justify-content: center;
padding: 3rem 0;
}
.term-window {
width: 100%;
max-width: 680px;
background: var(--tw-bg);
border-radius: 10px;
border: 1px solid var(--tw-border);
box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
overflow: hidden;
font-family: var(--font-mono);
font-size: clamp(0.78rem, 1.5vw, 0.9rem);
transition:
background-color 0.3s ease,
border-color 0.3s ease;
}
.term-titlebar {
background: var(--tw-bar);
padding: 0.7rem 1rem;
display: flex;
align-items: center;
gap: 0.75rem;
border-bottom: 1px solid var(--tw-border);
user-select: none;
}
.term-dots {
display: flex;
gap: 0.45rem;
span {
display: block;
width: 12px;
height: 12px;
border-radius: 50%;
}
.dot-red {
background: #ff5f57;
}
.dot-yellow {
background: #febc2e;
}
.dot-green {
background: #28c840;
}
}
.term-titlebar-label {
flex: 1;
text-align: center;
font-size: 0.72rem;
color: var(--tw-muted);
letter-spacing: 0.03em;
}
.term-body {
padding: 1.5rem;
line-height: 1.65;
color: var(--tw-text);
min-height: 260px;
}
.term-row {
display: flex;
align-items: baseline;
gap: 0;
white-space: nowrap;
overflow: hidden;
}
.term-ps1 {
color: var(--tw-prompt);
flex-shrink: 0;
white-space: nowrap;
pointer-events: none;
}
.term-input {
color: var(--tw-text);
overflow: hidden;
}
.term-out {
margin-bottom: 0.9rem;
}
.term-out-error {
color: var(--tw-error);
}
.term-out-muted {
color: var(--tw-muted);
margin-bottom: 0.9rem;
}
.term-out-ls {
display: flex;
flex-wrap: wrap;
gap: 0.5rem 1.5rem;
margin-bottom: 0.9rem;
a {
color: var(--tw-link);
text-decoration: none;
font-weight: 500;
&::before {
content: '→ ';
color: var(--tw-prompt);
}
&:hover {
color: var(--tw-prompt);
text-decoration: underline;
}
}
}
.term-cursor {
display: inline-block;
width: 0.55em;
height: 1.1em;
background: var(--tw-cursor);
vertical-align: text-bottom;
animation: blink-cursor 1s step-end infinite;
margin-left: 0.15ch;
}
@keyframes blink-cursor {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0;
}
}
+626
View File
@@ -0,0 +1,626 @@
// Article details and content styling
.reading-progress-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 3px;
background-color: transparent;
z-index: 1000;
pointer-events: none;
}
.reading-progress-bar {
height: 100%;
width: 0%;
background-color: var(--accent-color);
box-shadow: 0 0 10px rgba(16, 185, 129, 0.5); /* Glowing emerald accent */
transition: width 0.1s cubic-bezier(0.25, 0.8, 0.25, 1);
}
// Post Detail
.post-detail {
max-width: 800px;
margin: 0 auto;
padding-top: 4rem;
}
.post-header {
margin-bottom: 4rem;
}
.post-title {
margin-bottom: 1rem;
}
.post-meta {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.4rem 0.75rem;
color: var(--text-muted);
font-size: 0.9rem;
font-style: italic;
}
.post-meta-item {
display: inline-flex;
align-items: center;
gap: 0.35rem;
}
.post-meta-label {
font-style: normal;
font-size: 0.75rem;
font-family: var(--font-mono);
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(--accent-color);
opacity: 0.8;
}
.post-meta-sep {
color: var(--border-color);
font-style: normal;
user-select: none;
}
.post-meta-updated time {
color: var(--text-muted);
}
// Heading anchor links
.post-body {
h2,
h3 {
position: relative;
.heading-anchor {
display: inline-block;
margin-left: 0.5em;
color: var(--accent-color);
font-family: var(--font-mono);
font-weight: 400;
font-size: 0.75em;
opacity: 0;
text-decoration: none;
vertical-align: middle;
transition: opacity 0.15s ease;
user-select: none;
}
&:hover .heading-anchor {
opacity: 1;
}
}
}
// ──────────────────────────────────────────
// Series Navigation Box
// ──────────────────────────────────────────
.series-nav {
background: var(--surface-color);
border: 1px solid var(--border-color);
border-left: 3px solid var(--accent-color);
border-radius: 12px;
padding: 1.25rem 1.5rem;
margin-bottom: 2rem;
}
.series-nav-header {
display: flex;
align-items: baseline;
flex-wrap: wrap;
gap: 0.4rem 0.75rem;
margin-bottom: 1rem;
}
.series-nav-eyebrow {
font-family: var(--font-mono);
font-size: 0.7rem;
text-transform: uppercase;
letter-spacing: 0.1em;
color: var(--accent-color);
opacity: 0.8;
}
.series-nav-title {
font-weight: 600;
font-size: 0.95rem;
color: var(--heading-color, var(--text-color));
flex: 1;
}
.series-nav-badge {
font-family: var(--font-mono);
font-size: 0.75rem;
color: var(--text-muted);
background: var(--bg-color);
border: 1px solid var(--border-color);
border-radius: 99px;
padding: 0.1em 0.6em;
white-space: nowrap;
}
.series-nav-list {
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-direction: column;
gap: 0.4rem;
}
.series-nav-item {
display: flex;
align-items: baseline;
gap: 0.75rem;
&.is-current {
.series-nav-index {
color: var(--accent-color);
}
.series-nav-label {
color: var(--text-color);
font-weight: 600;
}
}
}
.series-nav-index {
font-family: var(--font-mono);
font-size: 0.7rem;
color: var(--text-muted);
opacity: 0.6;
flex-shrink: 0;
width: 1.5ch;
text-align: right;
}
.series-nav-label {
font-size: 0.9rem;
color: var(--text-muted);
text-decoration: none;
&:hover {
color: var(--accent-color);
}
}
.post-toc {
background: var(--surface-color);
border: 1px solid var(--border-color);
padding: 1.5rem;
border-radius: 12px;
margin-bottom: 3rem;
summary {
font-weight: 600;
cursor: pointer;
list-style: none; /* Hide default arrow */
display: flex;
align-items: center;
gap: 0.5rem;
&::before {
content: '↓';
color: var(--accent-color);
transition: transform 0.2s ease;
}
}
&[open] summary::before {
transform: rotate(180deg);
}
ul {
margin-top: 1rem;
margin-bottom: 0;
list-style-type: none;
padding-left: 1rem;
}
li {
margin-bottom: 0.5rem;
}
a {
color: var(--text-muted);
font-size: 0.95em;
&:hover {
color: var(--accent-color);
}
}
}
.post-tags-share {
display: flex;
flex-direction: column;
gap: 2rem;
margin-top: 4rem;
@media (min-width: 640px) {
flex-direction: row;
justify-content: space-between;
align-items: center;
}
}
.post-tags {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
.tag {
background: var(--surface-color);
border: 1px solid var(--border-color);
padding: 0.25rem 0.75rem;
border-radius: 99px;
font-size: 0.85rem;
font-family: var(--font-mono);
}
}
.social-share {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.75rem;
.share-label {
font-weight: 500;
color: var(--text-color);
margin-right: 0.25rem;
}
.share-btn {
display: flex;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
border-radius: 50%;
background: var(--surface-color);
border: 1px solid var(--border-color);
color: var(--text-muted);
transition: var(--transition-smooth);
cursor: pointer;
&:hover {
color: var(--bg-color);
transform: translateY(-2px);
border-color: transparent;
&.x {
background: #000000;
color: #ffffff;
}
&.bluesky {
background: #0285ff;
}
&.linkedin {
background: #0077b5;
}
&.reddit {
background: #ff4500;
}
&.hackernews {
background: #ff6600;
}
&.email {
background: #6b7280;
}
}
}
}
.post-nav {
display: flex;
flex-direction: column;
align-items: center;
gap: 1.5rem;
margin-top: 3rem;
padding-top: 2rem;
border-top: 1px solid var(--border-color);
}
.post-nav-link {
display: flex;
flex-direction: column;
gap: 0.35rem;
align-items: center;
text-align: center;
max-width: 34ch;
}
.post-nav-label {
color: var(--accent-color);
font-size: 0.9rem;
font-weight: 500;
}
.post-nav-title {
font-size: 1rem;
line-height: 1.35;
color: var(--text-muted);
transition: color 0.2s ease;
}
.post-nav-link:hover .post-nav-title,
.post-nav-link:hover .post-nav-label {
color: var(--accent-color);
}
@media (max-width: 640px) {
.post-nav-title {
font-size: 0.95rem;
}
}
@media (min-width: 900px) {
.post-nav {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 2rem;
align-items: start;
}
.post-nav-prev {
justify-self: start;
align-items: flex-start;
text-align: left;
}
.post-nav-next {
justify-self: end;
align-items: flex-end;
text-align: right;
}
}
// ──────────────────────────────────────────
// Sidebar TOC Layout
// ──────────────────────────────────────────
.post-layout {
display: contents;
@media (min-width: 1200px) {
display: grid;
grid-template-columns: minmax(0, 800px) 240px;
gap: 3rem;
align-items: start;
max-width: 1100px;
margin: 0 auto;
}
}
@media (min-width: 1200px) {
.post-detail {
max-width: none;
margin: 0;
}
// Hide inline TOC — sidebar takes over
.post-toc {
display: none !important;
}
}
.post-toc-sidebar {
display: none;
@media (min-width: 1200px) {
display: block;
position: sticky;
top: 5.5rem;
max-height: calc(100vh - 7rem);
overflow-y: auto;
padding-top: 4rem; // align with article content start
scrollbar-width: thin;
scrollbar-color: var(--border-color) transparent;
&::-webkit-scrollbar {
width: 4px;
}
&::-webkit-scrollbar-track {
background: transparent;
}
&::-webkit-scrollbar-thumb {
background: var(--border-color);
border-radius: 4px;
}
}
}
.toc-nav {
ul {
list-style: none;
padding: 0;
margin: 0;
// Nested level (h2 children)
ul {
padding-left: 1rem;
margin-top: 0.25rem;
}
}
li {
margin-bottom: 0.35rem;
}
a {
display: block;
color: var(--text-muted);
font-size: 0.85rem;
line-height: 1.4;
padding: 0.2rem 0;
border-left: 2px solid transparent;
padding-left: 0.75rem;
transition:
color 0.2s ease,
border-color 0.2s ease;
text-decoration: none;
&:hover {
color: var(--accent-color);
}
&.toc-active {
color: var(--accent-color);
border-left-color: var(--accent-color);
}
}
}
.toc-sidebar-title {
font-size: 0.75rem;
font-family: var(--font-mono);
text-transform: uppercase;
letter-spacing: 0.1em;
color: var(--text-muted);
margin: 0 0 1rem 0;
padding-left: 0.75rem;
}
// ──────────────────────────────────────────
// Media Wrappers (YouTube, etc)
// ──────────────────────────────────────────
.youtube-wrapper {
position: relative;
width: 100%;
aspect-ratio: 16 / 9;
border-radius: 8px;
overflow: hidden;
border: 1px solid var(--border-color);
margin: 2rem 0;
background: #000;
iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 0;
}
}
// ──────────────────────────────────────────
// Callouts / Admonitions
// ──────────────────────────────────────────
.callout {
margin: 2rem 0;
padding: 1.25rem 1.5rem;
border-radius: 6px;
border-left: 4px solid var(--callout-color, var(--border-color));
background: var(--surface-color);
color: var(--text-color);
font-size: 0.95rem;
line-height: 1.6;
.callout-header {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 0.5rem;
font-weight: 600;
color: var(--callout-color, var(--heading-color));
}
.callout-icon {
width: 1.25rem;
height: 1.25rem;
flex-shrink: 0;
}
.callout-title {
font-family: var(--font-mono);
text-transform: uppercase;
letter-spacing: 0.05em;
font-size: 0.85rem;
}
.callout-content {
> :first-child {
margin-top: 0;
}
> :last-child {
margin-bottom: 0;
}
}
// Variants
&.callout-note {
--callout-color: #3b82f6; // Blue
background: rgba(59, 130, 246, 0.05);
}
&.callout-warning {
--callout-color: #f59e0b; // Amber
background: rgba(245, 158, 11, 0.05);
}
&.callout-tip {
--callout-color: #10b981; // Emerald
background: rgba(16, 185, 129, 0.05);
}
&.callout-danger {
--callout-color: #ef4444; // Red
background: rgba(239, 68, 68, 0.05);
}
}
// ──────────────────────────────────────────
// Related Posts
// ──────────────────────────────────────────
.related-posts-section {
margin-top: 4rem;
padding-top: 2rem;
border-top: 1px dashed var(--border-color);
h3 {
margin-bottom: 2rem;
font-size: 1.5rem;
color: var(--heading-color);
letter-spacing: -0.02em;
}
.related-posts-grid {
display: grid;
grid-template-columns: 1fr;
gap: 2rem;
@media (min-width: 768px) {
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 2.5rem;
}
// Override some constraints from feed-page cards when inside the grid
.feed-item {
border-bottom: none !important;
padding-bottom: 0 !important;
background: var(--surface-color);
border: 1px solid var(--border-color);
border-radius: 8px;
padding: 1.5rem !important;
height: 100%;
display: flex;
flex-direction: column;
transition: var(--transition-smooth);
&:hover {
border-color: var(--accent-color);
transform: translateY(-4px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.item-snippet {
flex: 1;
}
}
}
}
+180
View File
@@ -0,0 +1,180 @@
// Post Feed Page Container
.feed-page {
max-width: 800px;
margin: 0 auto;
}
// Post Feed
.post-feed {
display: flex;
flex-direction: column;
gap: 3rem;
margin-top: 2rem;
}
// Homepage "View all posts" CTA
.view-all-posts {
display: flex;
justify-content: center;
margin: 3rem auto 0;
max-width: var(--content-width);
}
.btn-view-all {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.6rem 1.5rem;
border: 1px solid var(--accent-color);
border-radius: 6px;
font-family: var(--font-mono);
font-size: 0.875rem;
color: var(--accent-color);
background: transparent;
text-decoration: none;
transition: var(--transition-smooth);
letter-spacing: 0.04em;
&::after {
content: '→';
transition: transform 0.2s ease;
}
&:hover {
background: var(--accent-color);
color: var(--bg-color);
&::after {
transform: translateX(4px);
}
}
}
.feed-item {
display: block;
}
.item-link {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.item-date {
font-size: 0.85rem;
color: var(--text-muted);
font-variant-numeric: tabular-nums;
letter-spacing: 0.05em;
text-transform: uppercase;
}
.item-title {
margin: 0;
font-size: clamp(1.5rem, 2vw, 2rem);
transition: color 0.2s ease;
}
.item-link:hover .item-title {
color: var(--accent-color);
}
.item-desc {
margin: 0;
color: var(--text-muted);
}
// ──────────────────────────────────────────
// Pagination
// ──────────────────────────────────────────
.pagination {
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
margin-top: 5rem;
padding-top: 2rem;
border-top: 1px solid var(--border-color);
font-family: var(--font-mono);
}
.pagination-pages {
display: flex;
align-items: center;
gap: 0.25rem;
}
// Shared base for arrows + numbers
.pagination-arrow,
.pagination-num {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 2.25rem;
height: 2.25rem;
padding: 0 0.5rem;
border-radius: 6px;
border: 1px solid var(--border-color);
background: var(--surface-color);
color: var(--text-muted);
font-size: 0.875rem;
text-decoration: none;
transition: var(--transition-smooth);
cursor: pointer;
user-select: none;
&:hover {
border-color: var(--accent-color);
color: var(--accent-color);
transform: translateY(-1px);
}
}
// Active / current page
.pagination-num.is-current {
background: var(--accent-color);
border-color: var(--accent-color);
color: #fff;
font-weight: 600;
cursor: default;
pointer-events: none;
&:hover {
transform: none;
}
}
// Disabled arrow (no prev/next page)
.pagination-arrow.is-disabled {
opacity: 0.3;
cursor: not-allowed;
pointer-events: none;
&:hover {
border-color: var(--border-color);
color: var(--text-muted);
transform: none;
}
}
// Ellipsis gap marker
.pagination-ellipsis {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 2.25rem;
height: 2.25rem;
color: var(--text-muted);
font-size: 0.875rem;
letter-spacing: 0.05em;
}
// "Page N of M" helper text
.pagination-meta {
text-align: center;
margin-top: 1rem;
margin-bottom: 0;
font-size: 0.8rem;
color: var(--text-muted);
font-family: var(--font-mono);
letter-spacing: 0.05em;
}
+9
View File
@@ -0,0 +1,9 @@
// Footer
.site-footer {
padding: 3rem 0;
border-top: 1px solid var(--border-color);
color: var(--text-muted);
font-size: 0.9rem;
display: flex;
justify-content: space-between;
}
+152
View File
@@ -0,0 +1,152 @@
// Component: Header
.site-header {
padding: 1.25rem 0;
position: sticky;
top: 0;
z-index: 50;
background-color: var(--bg-color);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border-bottom: 1px solid var(--border-color);
}
.nav-container {
display: flex;
justify-content: space-between;
align-items: center;
}
// Right side wrapper (links + controls)
.nav-right {
display: flex;
align-items: center;
gap: 1rem;
}
// Always-visible icon controls
.nav-controls {
display: flex;
align-items: center;
gap: 0.5rem;
}
.search-toggle {
background: none;
border: none;
color: var(--text-color);
cursor: pointer;
padding: 0.35rem;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
transition: var(--transition-smooth);
&:hover {
color: var(--accent-color);
}
}
// Hamburger button — hidden on desktop, shown on mobile
.nav-toggle {
display: none;
background: none;
border: none;
color: var(--text-color);
cursor: pointer;
padding: 0.25rem;
align-items: center;
justify-content: center;
.close-icon {
display: none;
}
&[aria-expanded='true'] {
.hamburger-icon {
display: none;
}
.close-icon {
display: block;
}
}
}
@media (max-width: 640px) {
.nav-toggle {
display: flex;
}
// Hide the site name when the menu is open
.nav-container:has(#nav-toggle[aria-expanded='true']) .brand-link {
display: none;
}
// Make nav-right fill the full width so menu items span the container
.nav-container:has(#nav-toggle[aria-expanded='true']) .nav-right {
width: 100%;
}
.nav-right {
flex-wrap: wrap;
justify-content: flex-end;
}
.nav-links {
display: none !important;
flex-direction: column !important;
align-items: flex-start !important;
gap: 0 !important;
width: 100%;
order: 10; // push below nav-controls
padding: 1rem 0;
border-top: 1px solid var(--border-color);
margin-top: 0.5rem;
&.is-open {
display: flex !important;
}
.nav-item {
width: 100%;
padding: 0.75rem 0;
font-size: 1rem;
border-bottom: 1px solid var(--border-color);
&::after {
display: none;
}
}
}
}
.brand-text {
font-weight: 700;
font-size: 1.2rem;
letter-spacing: -0.01em;
}
.nav-links {
display: flex;
align-items: center;
gap: 1.5rem;
}
.nav-item {
font-weight: 500;
font-size: 0.95rem;
position: relative;
}
.nav-item::after {
content: '';
position: absolute;
width: 0;
height: 2px;
bottom: -4px;
left: 0;
background-color: var(--accent-color);
transition: var(--transition-smooth);
}
.nav-item:hover::after {
width: 100%;
}
+14
View File
@@ -0,0 +1,14 @@
// Hero Section
.hero {
padding: 8rem 0 6rem 0;
max-width: 800px;
}
.hero-title {
color: var(--text-color);
}
.hero-subtitle {
font-size: clamp(1.1rem, 1.5vw, 1.3rem);
color: var(--text-muted);
}
+37
View File
@@ -0,0 +1,37 @@
// Layout Constraints
.site-container {
width: 100%;
max-width: 1400px;
margin: 0 auto;
padding: 0 5vw;
display: flex;
flex-direction: column;
min-height: 100dvh;
box-sizing: border-box;
}
// Constrain all media & tables to their container
img,
video,
iframe,
table,
svg {
max-width: 100%;
}
table {
display: block;
overflow-x: auto;
@media (max-width: 640px) {
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
}
}
// Main Content
.main-content {
flex-grow: 1;
padding-bottom: 5rem;
}
+58
View File
@@ -0,0 +1,58 @@
// Global Reset & Base
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
font-family: var(--font-sans);
font-size: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
background-color: var(--bg-color);
color: var(--text-color);
scroll-behavior: smooth;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
transition:
background-color 0.3s ease,
color 0.3s ease;
// Firefox
scrollbar-width: thin;
scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
// Webkit
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
background: var(--scrollbar-thumb);
border-radius: 0; // hard edges = terminal feel
border: 1px solid var(--scrollbar-track);
&:hover {
background: var(--scrollbar-thumb-hover);
}
}
body {
line-height: 1.7;
min-height: 100dvh;
display: flex;
flex-direction: column;
overflow-wrap: break-word; // break long words instead of overflowing
word-break: break-word;
}
a {
color: inherit;
text-decoration: none;
transition: var(--transition-smooth);
}
+60
View File
@@ -0,0 +1,60 @@
// Scroll to Top Floating Button
.scroll-to-top {
position: fixed;
bottom: 2rem;
right: 2rem;
display: flex;
align-items: center;
justify-content: center;
width: 3rem;
height: 3rem;
border-radius: 50%;
background: var(--bg-color);
color: var(--accent-color);
border: 1px solid var(--accent-color);
cursor: pointer;
z-index: 100;
// Hidden state by default
opacity: 0;
visibility: hidden;
transform: translateY(1rem);
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
// Visible state triggered by JS
&.visible {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
@media (hover: hover) {
&:hover {
background: var(--accent-color);
color: var(--bg-color);
transform: translateY(-0.25rem);
box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2); // Emerald glow matching accent
}
&:hover svg {
transform: translateY(-2px);
}
}
&:focus-visible {
outline: 2px solid var(--accent-color);
outline-offset: 4px;
}
svg {
transition: transform 0.2s ease;
}
// Responsive padding for mobile devices
@media (max-width: 768px) {
bottom: 1.5rem;
right: 1.5rem;
width: 2.75rem;
height: 2.75rem;
}
}
+151
View File
@@ -0,0 +1,151 @@
// Search Modal Styles
.search-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.4);
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
z-index: 10000;
display: flex;
justify-content: center;
align-items: flex-start;
padding-top: 10vh;
opacity: 0;
visibility: hidden;
transition:
opacity 0.2s ease,
visibility 0.2s ease;
&.active {
opacity: 1;
visibility: visible;
.search-modal {
transform: translateY(0) scale(1);
}
}
}
.search-modal {
width: 90%;
max-width: 600px;
background: var(--bg-color);
border: 1px solid var(--border-color);
border-radius: 12px;
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
transform: translateY(-20px) scale(0.98);
transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
display: flex;
flex-direction: column;
overflow: hidden;
}
.search-header {
display: flex;
align-items: center;
padding: 1rem 1.25rem;
border-bottom: 1px solid var(--border-color);
background: var(--surface-color);
svg {
color: var(--text-muted);
margin-right: 0.75rem;
}
}
#search-input {
flex: 1;
background: transparent;
border: none;
color: var(--text-color);
font-family: var(--font-sans);
font-size: 1.1rem;
outline: none;
&::placeholder {
color: var(--text-muted);
}
}
.search-footer {
padding: 0.5rem 1.25rem;
background: var(--surface-color);
border-top: 1px solid var(--border-color);
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.75rem;
color: var(--text-muted);
kbd {
background: var(--bg-color);
border: 1px solid var(--border-color);
border-radius: 4px;
padding: 0.1rem 0.3rem;
font-family: var(--font-mono);
font-size: 0.7rem;
margin: 0 0.2rem;
}
}
.search-results {
max-height: 50vh;
overflow-y: auto;
padding: 0.5rem;
// Custom scrollbar
&::-webkit-scrollbar {
width: 8px;
}
&::-webkit-scrollbar-track {
background: transparent;
}
&::-webkit-scrollbar-thumb {
background-color: var(--border-color);
border-radius: 4px;
}
.search-result-item {
display: flex;
flex-direction: column;
padding: 0.75rem 1rem;
border-radius: 8px;
text-decoration: none;
color: var(--text-color);
transition: background-color 0.15s ease;
border-left: 2px solid transparent;
&:hover,
&.selected {
background-color: var(--surface-color);
border-left-color: var(--accent-color);
}
.result-title {
font-weight: 500;
color: var(--accent-color);
margin-bottom: 0.25rem;
}
.result-summary {
font-size: 0.85rem;
color: var(--text-muted);
line-height: 1.4;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
}
.no-results {
padding: 2rem;
text-align: center;
color: var(--text-muted);
font-style: italic;
}
}
+31
View File
@@ -0,0 +1,31 @@
// Component: Theme Toggle
.theme-toggle {
background: none;
border: none;
color: var(--text-color);
cursor: pointer;
padding: 0.5rem;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
transition: var(--transition-smooth);
svg {
width: 20px;
height: 20px;
}
}
html.dark .sun-icon {
display: block;
}
html.dark .moon-icon {
display: none;
}
html:not(.dark) .sun-icon {
display: none;
}
html:not(.dark) .moon-icon {
display: block;
}
+55
View File
@@ -0,0 +1,55 @@
/*
* Cross-Document View Transitions
* Enabled via <meta name="view-transition" content="same-origin" />
*/
// Disable default CSS transitions on the whole page during a view transition
// so they don't fight with the View Transition API animation.
html::view-transition-group(*) {
animation-duration: 0.3s;
animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
// Custom animation for the old page leaving
@keyframes fade-out-scale {
from {
opacity: 1;
transform: scale(1);
}
to {
opacity: 0;
transform: scale(0.98);
}
}
// Custom animation for the new page entering
@keyframes fade-in-scale {
from {
opacity: 0;
transform: scale(1.02);
}
to {
opacity: 1;
transform: scale(1);
}
}
// Apply the custom animations to the root view transition pseudo-elements
html::view-transition-old(root) {
animation: fade-out-scale 0.25s cubic-bezier(0.4, 0, 1, 1) both;
}
html::view-transition-new(root) {
animation: fade-in-scale 0.35s cubic-bezier(0, 0, 0.2, 1) both;
// Delay slightly so the old page fades down first before the new one pops over
animation-delay: 0.05s;
}
// Respect user preference for reduced motion
@media (prefers-reduced-motion: reduce) {
html::view-transition-group(*),
html::view-transition-old(*),
html::view-transition-new(*) {
animation: none !important;
}
}
+182
View File
@@ -0,0 +1,182 @@
// Typography Scale (Fluid)
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: 700;
line-height: 1.1;
letter-spacing: -0.02em;
margin-bottom: 0.5em;
overflow-wrap: break-word;
word-break: break-word;
text-wrap: balance;
}
h1 {
font-size: clamp(1.75rem, 5vw, 4.5rem);
}
h2 {
font-size: clamp(1.35rem, 3vw, 2.5rem);
}
h3 {
font-size: clamp(1.2rem, 2vw, 1.8rem);
margin-top: 1.5em;
}
h4 {
font-size: clamp(1.05rem, 1.5vw, 1.3rem);
}
h5 {
font-size: clamp(1rem, 1.25vw, 1.15rem);
}
h6 {
font-size: clamp(0.9rem, 1vw, 1rem);
}
p,
ul,
ol,
figure,
blockquote {
margin-bottom: 1.5rem;
}
p {
max-width: 65ch; // Optimal reading width
text-wrap: pretty;
}
// Footnotes
.footnote-reference {
font-size: 0.75em;
vertical-align: super;
line-height: 0;
a {
color: var(--accent-color);
font-family: var(--font-mono);
padding: 0 0.15em;
&:hover {
text-decoration: underline;
}
}
}
.footnote-definition {
display: flex;
gap: 0.75rem;
margin-bottom: 0.75rem;
font-size: 0.875rem;
color: var(--text-muted);
border-left: 2px solid var(--border-color);
padding-left: 1rem;
p {
margin: 0;
max-width: none;
}
}
.footnote-definition-label {
flex-shrink: 0;
font-family: var(--font-mono);
color: var(--accent-color);
font-size: 0.8em;
margin-top: 0.1em;
}
.footnote-backref {
font-family: var(--font-mono);
color: var(--accent-color);
font-size: 0.9em;
text-decoration: none;
opacity: 0.7;
transition: opacity 0.2s ease;
&:hover {
opacity: 1;
}
}
code,
pre {
font-family: var(--font-mono);
font-size: 0.9em;
font-feature-settings:
'liga' 1,
'calt' 1;
font-variant-ligatures: contextual;
}
pre {
position: relative;
padding: 1.25rem;
border-radius: 8px;
overflow-x: auto;
max-width: 100%;
border: 1px solid var(--border-color);
background: #1e1e2e;
// Scrollbars visible on desktop, hidden on mobile
@media (max-width: 640px) {
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
font-size: 0.82em;
}
}
.copy-code-btn {
position: absolute;
top: 0.5rem;
right: 0.5rem;
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
background: rgba(255, 255, 255, 0.1);
color: #cdd6f4;
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 4px;
cursor: pointer;
opacity: 1;
transition:
background 0.2s ease,
color 0.2s ease;
svg {
width: 16px;
height: 16px;
}
&:hover {
background: rgba(255, 255, 255, 0.2);
color: #ffffff;
}
&.copied {
background: var(--accent-color);
border-color: var(--accent-color);
color: var(--bg-color);
}
}
// Button is always visible, no hover-to-reveal needed
code {
background: var(--surface-color);
padding: 0.2em 0.4em;
border-radius: 4px;
color: var(--accent-color);
border: 1px solid var(--border-color);
}
pre code {
background: transparent;
color: inherit;
padding: 0;
border: none;
}
+8
View File
@@ -0,0 +1,8 @@
// Utilities / Interactions
.hover-scale {
transition: var(--transition-spring);
&:active {
transform: scale(0.98);
}
}
+35
View File
@@ -0,0 +1,35 @@
// Premium Design Variables
:root {
--bg-color: #f9fafb;
--text-color: #1a1a1a;
--text-muted: #6b7280;
--accent-color: #10b981; // Emerald
--accent-hover: #059669; // Emerald darker
--surface-color: #ffffff;
--border-color: rgba(0, 0, 0, 0.05);
--shadow-color: rgba(0, 0, 0, 0.05);
--font-sans: 'Outfit', sans-serif;
--font-mono: 'JetBrains Mono', monospace;
--transition-spring: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
--transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
--scrollbar-track: #e5e7eb;
--scrollbar-thumb: #9ca3af;
--scrollbar-thumb-hover: #10b981;
}
// Dark Mode Overrides
html.dark {
--bg-color: #0a0a0a;
--text-color: #f9fafb;
--text-muted: #a1a1aa;
--surface-color: #141414;
--border-color: rgba(255, 255, 255, 0.1);
--shadow-color: rgba(0, 0, 0, 0.5);
--scrollbar-track: #0f0f0f;
--scrollbar-thumb: #2a2a2a;
--scrollbar-thumb-hover: #10b981;
}
+18
View File
@@ -0,0 +1,18 @@
// Main SCSS entry point
// Organized by feature and section for maintainability
@import 'variables';
@import 'reset';
@import 'typography';
@import 'layout';
@import 'header';
@import 'theme';
@import 'hero';
@import 'feed';
@import 'article';
@import 'footer';
@import 'search';
@import 'transitions';
@import 'utilities';
@import 'scroll-top';
@import '404';
-362
View File
@@ -1,362 +0,0 @@
/* TODO: Future considerations.
- Reset all margin and padding for * to 0.
- Use the <abbr> tag for abbreviations.
- Support footnotes or asides for notes sections.
- Serve fonts from the local server rather than Google's API.
- Support a "display title" in an [extra] section to allow for <br> elements
or other manual control over title display. */
@charset "utf-8";
@import url('https://fonts.googleapis.com/css?family=Noto+Sans|Noto+Serif|Noto+Sans+Mono');
:root {
/* Fonts and Text Sizes */
--default-serif-font: "Noto Serif", serif;
--default-sans-font: "Noto Sans", sans-serif;
--default-mono-font: "Noto Sans Mono", monospace;
--default-font-size: 14px;
--header-font-size: 2.0em;
/* Not sure I like this as the default, but it keeps inline code blocks from
overlapping. */
--default-line-height: 1.5;
/* Gruvbox Dark Colors */
--background-color: #1d2021;
--foreground-color: #ebdbb2;
--link-color: #458588;
--muted-color: #928374;
--primary-accent-color: #b16286;
--secondary-accent-color: #689d6a;
--code-background-color: #282828;
--inline-code-background-color: #3c3836;
}
.accent {
color: var(--primary-accent-color);
}
/* Required for sticky footer. */
html,
body {
height: 100%;
}
body {
display: flex;
/* Required for sticky footer. */
flex-direction: column;
/* Required for sticky footer. */
margin: 0;
line-height: var(--default-line-height);
font-size: var(--default-font-size);
font-family: var(--default-serif-font);
background-color: var(--background-color);
color: var(--foreground-color);
border-top: 0.5em solid var(--primary-accent-color);
}
main {
flex: 1 0 auto;
/* Required for sticky footer. */
}
/* FIXME: For reasons that utterly bewilder me, an <article> with this id needs
to be inside a <main> with no id. I have a strong feeling I've done
something wrong here. */
#content {
max-width: 48em;
margin-left: auto;
margin-right: auto;
padding-right: 1.4em;
padding-left: 1.4em;
padding-bottom: 1.4em;
}
header {
overflow: hidden;
/* FIXME: This WILL cut off titles that are too long! */
margin-top: 1.4em;
margin-bottom: 1.4em;
margin-left: 1em;
margin-right: 1em;
}
header>div.logo {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
header>h1 {
text-align: center;
font-size: var(--header-font-size);
font-family: var(--default-sans-font);
padding-top: 2.8rem;
margin-top: 0;
margin-bottom: 0.7rem;
}
header .post-meta {
text-align: center;
padding-top: 0.5em;
padding-bottom: 0.9em;
margin-bottom: 0;
}
.post-meta time {
// TODO: This color doesn't look great in with a light color scheme...
color: var(--muted-color);
}
h2,
h3,
h4,
h5,
h6 {
padding-top: 1.2rem;
margin-bottom: 0.2rem;
}
p {
padding-top: 0.4em;
margin-bottom: 1em;
}
blockquote {
/* Default text uses serif, so use sans-serif to differentiate quoted text. */
font-family: var(--default-sans-font);
font-style: italic;
/* Indent blockquotes, but align the start with where text in code begins. */
margin: 0 1.25rem;
padding-left: 1.25rem;
padding-right: 1.25rem;
border-left: 3px solid var(--secondary-accent-color);
}
a {
color: var(--link-color);
text-decoration: none;
}
/* ---- Anchor links --------------------------------------------------------*/
/* Add a # to the left of a subheading when it references an internal link... */
:where(h2, h3, h4, h5, h6)>a[href^="#"]::before {
content: "#";
display: inline-block;
width: 1.2rem;
margin-left: -1.2rem;
opacity: 0;
}
/* ... but only display the internal anchor link when hovered over. */
:where(h2, h3, h4, h5, h6):hover>a[href^="#"]::before {
opacity: 1;
}
/* When internal links are linked directly, display with the accent color. */
:where(h2, h3, h4, h5, h6):target>a[href^="#"]::before {
opacity: 1;
color: var(--primary-accent-color);
}
/* ---- Media ---------------------------------------------------------------*/
img.logo {
width: 64px;
height: 64px;
}
img,
video {
/* Media should fill the width of its container if possible. */
width: 100%;
height: auto;
}
figure {
/* Don't add margins to figures. */
margin: 0;
}
figcaption {
/* De-emphasize figure captions. */
font-size: 0.85rem;
color: var(--muted-color);
}
/* ---- Code blocks ---------------------------------------------------------*/
pre {
display: block;
padding: 0.25rem 1.25rem;
font-size: 85%;
border-left: 0.25rem solid var(--primary-accent-color);
}
code {
padding: 0 0.4rem;
// background-color: #3c3836;
background-color: var(--inline-code-background-color);
/* Inline code blocks look less aggresive with a little rounding. */
border-radius: 2px;
}
pre,
code {
overflow: auto;
font-family: var(--default-mono-font);
}
/* Without this the <code> tag gains a little padding that offsets text by like
2 pixels. Let's *not* do that. */
pre>code {
padding: 0;
background-color: var(--code-background-color);
// Code inside a pre block doesn't need rounded borders.
border-radius: unset;
}
/* ---- Tables --------------------------------------------------------------*/
table {
/* FIXME: Use flexbox for centering? Frankly, this is still bad on mobile.
display: flex;
justify-content: center;
*/
display: block;
overflow-x: auto;
margin-left: auto;
margin-right: auto;
text-align: left;
border-collapse: collapse;
}
/* Headers in a row (column scoped) get a colored bottom border. */
th[scope="col"] {
padding-top: 0.4em;
border-bottom: 3px solid var(--secondary-accent-color);
}
/* Headers in a column (row scoped) get a colored right border. */
th[scope="row"] {
border-right: 3px solid var(--secondary-accent-color);
}
td {
text-align: center;
border: 1px solid var(--muted-color);
}
th,
td {
vertical-align: bottom;
padding-left: 0.4em;
padding-right: 0.4em;
border: 1px solid var(--muted-color);
}
/* ---- Footer, nav, and copyright ------------------------------------------*/
footer {
border-top: 0.5em solid var(--primary-accent-color);
text-align: center;
/* FIXME: Using the code background color could look awkward if a post ends
in a code snippet. */
background-color: var(--code-background-color);
padding: 1.4em;
flex-shrink: 0;
/* Required for sticky footer. */
}
footer a {
color: var(--secondary-accent-color);
}
/* Give footer nav links some breathing room. */
footer>nav>a {
// margin: 0 1.4em;
margin: 0 0.4em;
}
/* FIXME: This could probably go away with global margin/padding adjustments. */
footer p {
padding-top: 0;
}
footer p,
footer a {
font-family: var(--default-sans-font);
/* It doesn't seem as though Google fonts support direct usage of OpenType
features like 'c2sc' and 'smcp'.
FIXME: It's not clear why numerals don't seem to obey this property. */
font-variant-caps: all-small-caps;
}
/* ---- Media Queries ------------------------------------------------------ */
@media(min-width: 427px) {
:root {
--default-font-size: 16px
}
}
@media(min-width: 470px) {
:root {
--default-font-size: 17px;
}
/* Above this size, increase the header margins. Smaller sizes benefit from
extra breathing room in the title. */
header {
margin-left: 2.8em;
margin-right: 2.8em;
}
header>div.logo {
flex-direction: row;
}
img.logo {
margin-right: 0.8em;
}
}
@media(min-width: 625px) {
:root {
--default-font-size: 18px;
}
}
@media(min-width: 802px) {
:root {
--default-font-size: 19px;
}
}
@media(min-width: 1003px) {
:root {
--default-font-size: 20px;
}
}
@media(min-width: 1225px) {
:root {
--default-font-size: 21px;
}
/* On larger devices, give the anchor link some more space. */
:where(h2, h3, h4, h5, h6)>a[href^="#"]::before {
width: 1.8rem;
margin-left: -1.8rem;
}
}
@media(min-width: 1496px) {
:root {
--default-font-size: 22px;
}
}