Skip to content

Commit 8115b77

Browse files
committed
feat(docs): refine dark mode across site
- Hero: readable subtitle/body, outline button visibility, reliable background asset - Navbar: aligned toggle and sponsor; single active icon only - Docs: improved dark-mode typography and TOC contrast - Blog: readable tag links in dark mode with hover/focus closes #0
1 parent 086a010 commit 8115b77

1 file changed

Lines changed: 159 additions & 13 deletions

File tree

codeprism-docs/src/css/custom.css

Lines changed: 159 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/* Only show the icon for the active color mode; hide others */
2+
html[data-theme='light'] .darkToggleIcon_wfgR,
3+
html[data-theme='light'] .systemToggleIcon_QzmC { display: none !important; }
4+
html[data-theme='dark'] .lightToggleIcon_pyhR,
5+
html[data-theme='dark'] .systemToggleIcon_QzmC { display: none !important; }
6+
@media (prefers-color-scheme: dark) {
7+
html[data-theme='system'] .lightToggleIcon_pyhR { display: none !important; }
8+
html[data-theme='system'] .darkToggleIcon_wfgR { display: inline !important; }
9+
}
10+
@media (prefers-color-scheme: light) {
11+
html[data-theme='system'] .lightToggleIcon_pyhR { display: inline !important; }
12+
html[data-theme='system'] .darkToggleIcon_wfgR { display: none !important; }
13+
}
114
/**
215
* Any CSS included here will be global. The classic template
316
* bundles Infima by default. Infima is a CSS framework designed to
@@ -274,6 +287,16 @@ p {
274287
color: var(--black) !important;
275288
}
276289

290+
/* Dark mode hero subtitle readability */
291+
[data-theme='dark'] .hero__subtitle {
292+
color: #cfd6de !important;
293+
}
294+
295+
/* Dark mode hero body text readability */
296+
[data-theme='dark'] .hero p {
297+
color: var(--rustic-text) !important;
298+
}
299+
277300
/* Target sponsor button in navbar specifically */
278301
.navbar__item [href*="sponsor"],
279302
a[href*="sponsor"] {
@@ -293,9 +316,12 @@ a[href*="sponsor"] {
293316
/* Ensure navbar sponsor link uses readable text color and size */
294317
nav.navbar a[href*="sponsor"] {
295318
color: var(--rustic-black) !important;
296-
padding: 8px 16px !important;
319+
padding: 0 16px !important;
297320
font-size: 16px !important;
298-
line-height: 24px !important;
321+
line-height: 1 !important;
322+
display: inline-flex !important;
323+
align-items: center !important;
324+
height: 48px !important;
299325
}
300326

301327
.navbar__item [href*="sponsor"]:hover,
@@ -330,6 +356,13 @@ a[href*="sponsor"]:hover {
330356
border-color: var(--black);
331357
}
332358

359+
/* Ensure outline buttons are visible in dark mode */
360+
[data-theme='dark'] .hero .button--outline,
361+
[data-theme='dark'] .button--outline {
362+
color: var(--rustic-text) !important;
363+
border-color: var(--rustic-text) !important;
364+
}
365+
333366
/* Navbar - Clean and minimal */
334367
.navbar {
335368
background: var(--white);
@@ -353,6 +386,24 @@ a[href*="sponsor"]:hover {
353386
align-items: center;
354387
}
355388

389+
/* Constrain navbar content and provide consistent side padding */
390+
.navbar__inner {
391+
width: 100%;
392+
margin: 0; /* full-width like before */
393+
padding-left: 24px;
394+
padding-right: 24px;
395+
}
396+
397+
.navbar__items {
398+
align-items: center;
399+
}
400+
401+
.navbar__items--right {
402+
gap: 12px;
403+
padding-right: 24px; /* keep controls comfortably inside edge */
404+
margin-left: auto; /* push to the far right */
405+
}
406+
356407
/* Brand logo sizing and spacing */
357408
.navbar__brand {
358409
padding-left: 0.75rem;
@@ -374,14 +425,22 @@ button[title*="dark"],
374425
button[title*="light"],
375426
button[aria-label*="dark"],
376427
button[aria-label*="light"] {
377-
width: 64px !important;
378-
height: 64px !important;
428+
width: 48px !important;
429+
height: 48px !important;
379430
display: inline-flex !important;
380431
align-items: center !important;
381432
justify-content: center !important;
382-
margin-left: 0.75rem !important;
383-
margin-right: 0.75rem !important;
384-
border-radius: 8px; /* keeps it neat if background applied by theme */
433+
margin-left: 0.75rem !important; /* 12px */
434+
margin-right: 0 !important; /* keep inside right padding */
435+
margin-top: 0 !important;
436+
margin-bottom: 0 !important;
437+
padding: 0 !important;
438+
line-height: 1 !important;
439+
vertical-align: middle !important;
440+
align-self: center !important;
441+
border-radius: 8px;
442+
/* nudge whole control up by 4px for visual alignment with Sponsor */
443+
transform: translateY(-4px);
385444
}
386445

387446
/* Make sure the icon inside the toggle scales appropriately */
@@ -390,8 +449,28 @@ button[title*="dark"] svg,
390449
button[title*="light"] svg,
391450
button[aria-label*="dark"] svg,
392451
button[aria-label*="light"] svg {
393-
width: 28px;
394-
height: 28px;
452+
width: 22px;
453+
height: 22px;
454+
}
455+
456+
/* Keep toggle compact at all breakpoints for alignment with Sponsor */
457+
@media (min-width: 1200px) {
458+
button[aria-label="Switch between dark and light mode"],
459+
button[title*="dark"],
460+
button[title*="light"],
461+
button[aria-label*="dark"],
462+
button[aria-label*="light"] {
463+
width: 48px !important;
464+
height: 48px !important;
465+
}
466+
button[aria-label="Switch between dark and light mode"] svg,
467+
button[title*="dark"] svg,
468+
button[title*="light"] svg,
469+
button[aria-label*="dark"] svg,
470+
button[aria-label*="light"] svg {
471+
width: 22px;
472+
height: 22px;
473+
}
395474
}
396475

397476
.navbar__brand {
@@ -449,7 +528,7 @@ button[aria-label*="light"] svg {
449528
background:
450529
linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)),
451530
linear-gradient(rgb(255, 255, 255), rgba(255, 255, 255, 0) 89%, rgb(255, 255, 255) 102%),
452-
url('/img/cell-pattern.png');
531+
url('@site/static/img/cell-pattern.png');
453532
background-size: auto, auto, 120px;
454533
background-repeat: repeat, repeat, repeat;
455534
color: var(--rustic-black);
@@ -462,7 +541,7 @@ button[aria-label*="light"] svg {
462541
background:
463542
linear-gradient(rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.62)),
464543
linear-gradient(rgb(255, 255, 255), rgba(255, 255, 255, 0) 89%, rgb(255, 255, 255) 102%),
465-
url('/img/cell-pattern.png') !important;
544+
url('@site/static/img/cell-pattern.png') !important;
466545
background-size: auto, auto, 120px !important;
467546
background-repeat: repeat, repeat, repeat !important;
468547
}
@@ -503,6 +582,15 @@ button[aria-label*="light"] svg {
503582
background: var(--white) !important;
504583
}
505584

585+
/* Features grid dark-mode polishing */
586+
[data-theme='dark'] .features .col {
587+
border: 1px solid var(--rustic-light-grey) !important;
588+
background: rgba(255, 255, 255, 0.03) !important;
589+
}
590+
[data-theme='dark'] .features .col:hover {
591+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
592+
}
593+
506594
/* CodePrism section styling */
507595
.codeprismSection {
508596
background: var(--white) !important;
@@ -896,7 +984,7 @@ a[href*="Sponsors"]:hover {
896984
.hero__subtitle {
897985
font-size: 1.25rem;
898986
}
899-
987+
900988
.button {
901989
padding: 0.6rem 1rem;
902990
font-size: 0.9rem;
@@ -1020,7 +1108,7 @@ hr {
10201108
background:
10211109
linear-gradient(rgba(24, 27, 32, 0.8), rgba(24, 27, 32, 0.8)),
10221110
linear-gradient(rgb(24, 27, 32), rgba(24, 27, 32, 0) 89%, rgb(24, 27, 32) 102%),
1023-
url('/img/cell-pattern.png') !important;
1111+
url('@site/static/img/cell-pattern.png') !important;
10241112
background-size: auto, auto, 120px !important;
10251113
}
10261114

@@ -1062,6 +1150,42 @@ hr {
10621150
color: var(--rustic-orange) !important;
10631151
}
10641152

1153+
/* Maintain strong hover affordance */
1154+
.footer a:hover, .footer a:focus {
1155+
text-decoration: underline !important;
1156+
}
1157+
1158+
/* Blog dark mode: ensure tag links are readable */
1159+
[data-theme='dark'] a[href*="/blog/tags/"] {
1160+
color: var(--rustic-text) !important;
1161+
}
1162+
[data-theme='dark'] a[href*="/blog/tags/"]:hover,
1163+
[data-theme='dark'] a[href*="/blog/tags/"]:focus {
1164+
color: var(--rustic-orange) !important;
1165+
text-decoration: underline !important;
1166+
}
1167+
1168+
/* Global dark-mode readability for docs/blog content */
1169+
[data-theme='dark'] .theme-doc-markdown,
1170+
[data-theme='dark'] .theme-doc-markdown p,
1171+
[data-theme='dark'] .theme-doc-markdown li,
1172+
[data-theme='dark'] article,
1173+
[data-theme='dark'] article p,
1174+
[data-theme='dark'] article li {
1175+
color: var(--rustic-text) !important;
1176+
}
1177+
1178+
[data-theme='dark'] .theme-doc-markdown a,
1179+
[data-theme='dark'] article a {
1180+
color: var(--rustic-orange) !important;
1181+
}
1182+
[data-theme='dark'] .theme-doc-markdown a:hover,
1183+
[data-theme='dark'] .theme-doc-markdown a:focus,
1184+
[data-theme='dark'] article a:hover,
1185+
[data-theme='dark'] article a:focus {
1186+
text-decoration: underline !important;
1187+
}
1188+
10651189
/* Quick Start layout tweaks for alignment and divider */
10661190
.hero .quickStart {
10671191
margin-top: 2rem !important;
@@ -1189,6 +1313,12 @@ pre samp {
11891313
[data-theme='dark'] .table-of-contents {
11901314
border-left: 1px solid var(--rustic-light-grey) !important;
11911315
}
1316+
[data-theme='dark'] .table-of-contents__link {
1317+
color: var(--rustic-text) !important;
1318+
}
1319+
[data-theme='dark'] .table-of-contents__link--active {
1320+
color: var(--rustic-orange) !important;
1321+
}
11921322
[data-theme='dark'] .theme-admonition {
11931323
border-left-color: var(--rustic-orange) !important;
11941324
}
@@ -1204,6 +1334,22 @@ pre samp {
12041334
border-right: 1px solid var(--gainsboro) !important;
12051335
}
12061336

1337+
/* Dark mode quick start refinement */
1338+
[data-theme='dark'] .hero .quickStart code {
1339+
background: rgba(255, 255, 255, 0.06) !important;
1340+
border: 1px solid var(--rustic-light-grey) !important;
1341+
}
1342+
[data-theme='dark'] .hero .quickStart .col:first-child {
1343+
border-right: 1px solid var(--rustic-light-grey) !important;
1344+
}
1345+
/* QuickStart container readability in dark */
1346+
[data-theme='dark'] .hero .quickStart {
1347+
color: var(--rustic-text) !important;
1348+
}
1349+
[data-theme='dark'] .hero .quickStart p {
1350+
color: var(--rustic-text) !important;
1351+
}
1352+
12071353
/* Dark mode buttons - ensure sponsor button works in dark mode */
12081354
[data-theme='dark'] .navbar__item [href*="sponsor"],
12091355
[data-theme='dark'] a[href*="sponsor"] {

0 commit comments

Comments
 (0)