Skip to content

Commit 9d1910a

Browse files
Copilotmgifford
andcommitted
fix: add strong, b { color: inherit } CSS rule and regression tests for color-contrast
Co-authored-by: mgifford <116832+mgifford@users.noreply.github.com> Agent-Logs-Url: https://github.com/mgifford/daily-dap/sessions/d84c08fa-ebd5-4a9b-9b5d-834c58897fd9
1 parent 743d82e commit 9d1910a

File tree

32 files changed

+92425
-19991
lines changed

32 files changed

+92425
-19991
lines changed

docs/404.html

Lines changed: 145 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@
227227
}
228228
a { color: var(--color-link); text-decoration: underline; }
229229
a:hover { color: var(--color-link-hover); }
230+
/* Explicit inherit prevents any injected theme CSS (e.g. legacy GitHub Pages Jekyll Minima
231+
color: #797979) from producing insufficient contrast on bold/strong text. */
232+
strong, b { color: inherit; }
230233
h1, h2, h3 { line-height: 1.25; margin-top: 1.5rem; margin-bottom: 0.5rem; }
231234
h1 { font-size: 1.6rem; }
232235
h2 { font-size: 1.25rem; }
@@ -307,7 +310,8 @@
307310
.github-link::before { content: ""; }
308311

309312
/* ---------- Theme toggle ---------- */
310-
.theme-toggle {
313+
.theme-toggle,
314+
.print-btn {
311315
background: transparent;
312316
border: 1px solid var(--color-header-nav);
313317
border-radius: 4px;
@@ -322,12 +326,14 @@
322326
white-space: nowrap;
323327
}
324328
.theme-toggle:hover,
325-
.theme-toggle[aria-pressed="true"] {
329+
.theme-toggle[aria-pressed="true"],
330+
.print-btn:hover {
326331
background: rgba(255, 255, 255, 0.15);
327332
color: var(--color-header-text);
328333
border-color: var(--color-header-text);
329334
}
330-
.theme-toggle:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
335+
.theme-toggle:focus-visible,
336+
.print-btn:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
331337

332338
/* ---------- Main wrapper ---------- */
333339
.site-main {
@@ -595,6 +601,50 @@
595601
@media (prefers-reduced-motion: no-preference) {
596602
.url-count-tooltip { transition: opacity 0.15s ease; }
597603
}
604+
/* Performance load-time tooltip (Performance column in top-URLs table) */
605+
.perf-time-trigger {
606+
display: inline-flex;
607+
align-items: center;
608+
cursor: help;
609+
text-decoration: underline dotted;
610+
position: relative;
611+
}
612+
.perf-time-trigger:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
613+
.perf-time-tooltip {
614+
position: absolute;
615+
bottom: calc(100% + 6px);
616+
left: 50%;
617+
transform: translateX(-50%);
618+
background: var(--color-tooltip-bg);
619+
color: var(--color-tooltip-text);
620+
border: 1px solid var(--color-tooltip-border);
621+
border-radius: 4px;
622+
padding: 0.4rem 0.6rem;
623+
font-size: 0.8rem;
624+
font-weight: normal;
625+
white-space: normal;
626+
max-width: 320px;
627+
min-width: 200px;
628+
z-index: 100;
629+
text-align: left;
630+
visibility: hidden;
631+
opacity: 0;
632+
pointer-events: none;
633+
word-break: break-word;
634+
}
635+
.perf-time-trigger:hover .perf-time-tooltip,
636+
.perf-time-trigger:focus-within .perf-time-tooltip {
637+
visibility: visible;
638+
opacity: 1;
639+
pointer-events: auto;
640+
}
641+
.perf-time-trigger[data-tooltip-dismissed] .perf-time-tooltip {
642+
visibility: hidden !important;
643+
opacity: 0 !important;
644+
}
645+
@media (prefers-reduced-motion: no-preference) {
646+
.perf-time-tooltip { transition: opacity 0.15s ease; }
647+
}
598648
.disability-legend {
599649
display: grid;
600650
grid-template-columns: auto 1fr;
@@ -607,6 +657,10 @@
607657
.fpc-prevalence { font-size: 0.85em; color: var(--color-text-muted); white-space: nowrap; }
608658
details summary { cursor: pointer; padding: 0.4rem 0; }
609659

660+
/* ---------- History chart ---------- */
661+
.history-chart-figure { margin: 0.5rem 0 1rem; overflow-x: auto; }
662+
.history-chart-figure svg { min-width: 320px; }
663+
610664
/* ---------- Axe policy narratives ---------- */
611665
.axe-narratives-details { margin: 1rem 0; }
612666
.axe-narratives-details > summary { font-weight: 600; }
@@ -660,6 +714,24 @@
660714
.score-cwv-needs-improvement { background-color: hsl(50 65% 86%); }
661715
.score-cwv-poor { background-color: hsl(50 50% 92%); }
662716

717+
/* ---------- Technology badges ---------- */
718+
.tech-badge {
719+
display: inline-block;
720+
font-size: 0.7rem;
721+
font-weight: 600;
722+
padding: 0.1em 0.4em;
723+
border-radius: 0.25em;
724+
white-space: nowrap;
725+
}
726+
.tech-badge-cms { background-color: hsl(200 60% 88%); color: hsl(200 60% 25%); }
727+
.tech-badge-uswds { background-color: hsl(225 70% 88%); color: hsl(225 70% 25%); }
728+
:root:not([data-color-scheme="light"]) .tech-badge-cms { background-color: hsl(200 40% 25%); color: hsl(200 40% 85%); }
729+
:root:not([data-color-scheme="light"]) .tech-badge-uswds { background-color: hsl(225 40% 25%); color: hsl(225 40% 85%); }
730+
html[data-color-scheme="dark"] .tech-badge-cms { background-color: hsl(200 40% 25%); color: hsl(200 40% 85%); }
731+
html[data-color-scheme="dark"] .tech-badge-uswds { background-color: hsl(225 40% 25%); color: hsl(225 40% 85%); }
732+
html[data-color-scheme="light"] .tech-badge-cms { background-color: hsl(200 60% 88%); color: hsl(200 60% 25%); }
733+
html[data-color-scheme="light"] .tech-badge-uswds { background-color: hsl(225 70% 88%); color: hsl(225 70% 25%); }
734+
663735
/* ---------- URL cells ---------- */
664736
.url-cell {
665737
white-space: nowrap;
@@ -801,6 +873,74 @@
801873
word-break: break-word;
802874
}
803875
}
876+
877+
/* ---------- Print / Save as PDF ---------- */
878+
.print-only { display: none; }
879+
.print-dashboard-notice {
880+
background: #f0f4ff;
881+
border: 1px solid #c0ccee;
882+
border-radius: 4px;
883+
font-size: 0.9rem;
884+
padding: 0.6rem 1rem;
885+
}
886+
887+
@media print {
888+
/* Hide interactive / navigational chrome */
889+
.skip-link,
890+
.site-header nav,
891+
.theme-toggle,
892+
.print-btn,
893+
.details-btn,
894+
.sort-btn,
895+
.copy-finding-btn,
896+
dialog,
897+
.axe-modal,
898+
.anchor-link { display: none !important; }
899+
900+
/* Show print-only elements (e.g., dashboard URL notice) */
901+
.print-only { display: block !important; }
902+
903+
/* Basic page setup */
904+
@page { margin: 1.5cm; }
905+
906+
body {
907+
background: #fff;
908+
color: #000;
909+
font-size: 11pt;
910+
}
911+
912+
/* Make the header readable in black-and-white */
913+
.site-header {
914+
background: #000 !important;
915+
color: #fff !important;
916+
-webkit-print-color-adjust: exact;
917+
print-color-adjust: exact;
918+
}
919+
920+
/* Keep score cards readable */
921+
.score-card {
922+
border: 1px solid #ccc;
923+
background: #fff !important;
924+
-webkit-print-color-adjust: exact;
925+
print-color-adjust: exact;
926+
}
927+
928+
/* Avoid page breaks inside key content blocks */
929+
section, .score-grid, .page-intro { break-inside: avoid; }
930+
931+
/* Expand truncated URL cells for print */
932+
.url-cell {
933+
max-width: none !important;
934+
white-space: normal !important;
935+
overflow: visible !important;
936+
text-overflow: clip !important;
937+
}
938+
939+
/* Remove table hover styles that rely on color */
940+
tr:hover { background: inherit !important; }
941+
942+
a[href]::after { content: none; }
943+
}
804944
</style>
805945
</head>
806946
<body>
@@ -873,14 +1013,14 @@ <h1 id="page-title">404 &mdash; Page Not Found</h1>
8731013
document.addEventListener('keydown', function (e) {
8741014
if (e.key === 'Escape') {
8751015
var el = document.activeElement;
876-
if (el && (el.classList.contains('disability-badge') || el.classList.contains('url-count-trigger'))) {
1016+
if (el && (el.classList.contains('disability-badge') || el.classList.contains('url-count-trigger') || el.classList.contains('perf-time-trigger'))) {
8771017
el.dataset.tooltipDismissed = 'true';
8781018
}
8791019
}
8801020
});
8811021
document.addEventListener('focusout', function (e) {
8821022
var el = e.target;
883-
if (el && (el.classList.contains('disability-badge') || el.classList.contains('url-count-trigger'))) {
1023+
if (el && (el.classList.contains('disability-badge') || el.classList.contains('url-count-trigger') || el.classList.contains('perf-time-trigger'))) {
8841024
delete el.dataset.tooltipDismissed;
8851025
}
8861026
});

0 commit comments

Comments
 (0)