diff --git a/bikeshed/refs/refhints.css b/bikeshed/refs/refhints.css index f6f61e2ba2..31570c554f 100644 --- a/bikeshed/refs/refhints.css +++ b/bikeshed/refs/refhints.css @@ -1,3 +1,14 @@ +:root { + --ref-hint-bg: #ddd; + --ref-hint-text: var(--text); +} +@media (prefers-color-scheme: dark) { + :root { + --ref-hint-bg: #222; + --ref-hint-text: var(--text); + } +} + .ref-hint { display: none; position: absolute; @@ -7,10 +18,10 @@ height: auto; max-height: 500px; overflow: auto; - padding: 0.5em 0.75em; + padding: 0.5em 0.5em; font: small Helvetica Neue, sans-serif, Droid Sans Fallback; - background: var(--dfnpanel-bg); - color: var(--dfnpanel-text); + background: var(--ref-hint-bg); + color: var(--ref-hint-text); border: outset 0.2em; white-space: normal; /* in case it's moved into a pre */ } diff --git a/bikeshed/refs/refhints.js b/bikeshed/refs/refhints.js index a0e03c49ec..ae45e2af28 100644 --- a/bikeshed/refs/refhints.js +++ b/bikeshed/refs/refhints.js @@ -64,15 +64,6 @@ refHint.classList.remove("on"); } - document.addEventListener("DOMContentLoaded", ()=>{ - genAllRefHints(); - - document.body.addEventListener("click", (e) => { - // If not handled already, just hide all link panels. - hideAllRefHints(); - }); - }) - function showRefHint(refHint) { hideAllRefHints(); // Only display one at this time. @@ -138,8 +129,17 @@ }); } + document.addEventListener("DOMContentLoaded", () => { + genAllRefHints(); + + document.body.addEventListener("click", (e) => { + // If not handled already, just hide all link panels. + hideAllRefHints(); + }); + }); + window.addEventListener("resize", () => { // Hide any open ref hint. hideAllRefHints(); - }) + }); } diff --git a/tests/github/w3c/csswg-drafts/css-align-3/Overview.html b/tests/github/w3c/csswg-drafts/css-align-3/Overview.html index f65d7deb79..1ece52c40d 100644 --- a/tests/github/w3c/csswg-drafts/css-align-3/Overview.html +++ b/tests/github/w3c/csswg-drafts/css-align-3/Overview.html @@ -5,10 +5,10 @@