|
1 | | -/* CSS Variables for theming */ |
| 1 | +/* |
| 2 | + Global CSS variables and design system tokens. |
| 3 | + These drive light/dark colors, spacing, typography, and layout. |
| 4 | + If you need to tweak the look-and-feel, prefer changing these first. |
| 5 | +*/ |
2 | 6 | :root { |
3 | 7 | /* Light theme colors */ |
4 | 8 | --bg-primary: #fafbfc; |
|
32 | 36 | --transition: all 0.2s ease; |
33 | 37 | } |
34 | 38 |
|
35 | | -/* Dark theme colors - Professional and modern */ |
| 39 | +/* |
| 40 | + Dark theme overrides. |
| 41 | + The <body> gets data-theme="dark" via JS (see baseof.html) which triggers these vars. |
| 42 | +*/ |
36 | 43 | [data-theme="dark"] { |
37 | 44 | --bg-primary: #0d1117; |
38 | 45 | --bg-secondary: #161b22; |
@@ -101,7 +108,10 @@ a:hover { |
101 | 108 | color: var(--accent-hover); |
102 | 109 | } |
103 | 110 |
|
104 | | -/* Header */ |
| 111 | +/* |
| 112 | + Header and top navigation bar. |
| 113 | + The mobile experience uses a hamburger that toggles a dropdown (see media query section). |
| 114 | +*/ |
105 | 115 | .site-header { |
106 | 116 | background-color: var(--bg-primary); |
107 | 117 | border-bottom: 1px solid var(--border-color); |
@@ -186,7 +196,10 @@ a:hover { |
186 | 196 | transform-origin: center; |
187 | 197 | } |
188 | 198 |
|
189 | | -/* Animate hamburger -> X */ |
| 199 | +/* |
| 200 | + Animate hamburger -> X when menu is open. |
| 201 | + JS toggles .mobile-menu-toggle.active (see baseof.html). |
| 202 | +*/ |
190 | 203 | .mobile-menu-toggle.active span:nth-child(1) { |
191 | 204 | transform: translateY(12px) rotate(45deg); |
192 | 205 | } |
@@ -448,7 +461,9 @@ a:hover { |
448 | 461 | position: relative; |
449 | 462 | } |
450 | 463 |
|
451 | | -/* Pascal compatibility capsules */ |
| 464 | +/* |
| 465 | + Compatibility "capsules" shown on code blocks (e.g., FPC). Purely decorative labels. |
| 466 | +*/ |
452 | 467 | .highlight.capsule-fpc::before { |
453 | 468 | content: 'FPC'; |
454 | 469 | position: absolute; |
@@ -597,13 +612,20 @@ hr { |
597 | 612 | color: var(--text-muted); |
598 | 613 | } |
599 | 614 |
|
600 | | -/* Responsive design */ |
| 615 | +/* |
| 616 | + Responsive design |
| 617 | + Mobile navigation lives here: a dropdown that expands/collapses with a smooth transition. |
| 618 | +*/ |
601 | 619 | @media (max-width: 768px) { |
602 | 620 | .container { |
603 | 621 | padding: 0 var(--spacing-md); |
604 | 622 | } |
605 | 623 |
|
606 | | - /* Mobile dropdown menu (smooth transition) */ |
| 624 | + /* |
| 625 | + Mobile dropdown menu (smooth transition) |
| 626 | + Hidden state uses max-height + opacity + translateY for a smooth open/close. |
| 627 | + We also keep the nav list in column layout in both states to avoid sideways shifting. |
| 628 | + */ |
607 | 629 | .navbar-menu { |
608 | 630 | display: flex; /* keep layout consistent */ |
609 | 631 | flex-direction: column; |
|
626 | 648 | visibility: hidden; |
627 | 649 | transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease; |
628 | 650 | } |
| 651 | + |
629 | 652 | /* Shown when hamburger is toggled */ |
630 | 653 | .navbar-menu.is-open { |
631 | 654 | max-height: 60vh; |
|
634 | 657 | pointer-events: auto; |
635 | 658 | visibility: visible; |
636 | 659 | } |
| 660 | + |
637 | 661 | /* Keep column layout during both open and closing transitions to prevent sideways shift */ |
638 | 662 | .navbar-menu .navbar-nav { |
639 | 663 | flex-direction: column; |
|
0 commit comments