From 5f9e23a965e7691e240bb39f901d2ef39c9991f1 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sun, 1 Mar 2026 18:07:29 +0100 Subject: [PATCH 1/2] fix: hide copy button when JS is disabled And move the button to the bottom of the box to align with previous tooling --- src/generators/legacy-html/assets/style.css | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/generators/legacy-html/assets/style.css b/src/generators/legacy-html/assets/style.css index bf46623f..5eaf8639 100644 --- a/src/generators/legacy-html/assets/style.css +++ b/src/generators/legacy-html/assets/style.css @@ -549,7 +549,6 @@ pre { pre > code { padding: 0; - float: left; } pre + h3 { @@ -1015,6 +1014,9 @@ kbd { filter: invert(1); } +:root:not(.has-js) .copy-button { + display: none; +} .copy-button { float: right; outline: none; @@ -1029,8 +1031,7 @@ kbd { text-transform: uppercase; font-weight: 700; padding: 0 0.5rem; - margin-right: 10px; - margin-top: -2px; + margin-right: 0.2rem; height: 1.5rem; transition-property: background-color, border-color, color, box-shadow, filter; From 157f868d35761e6b3d71fc5763592b426e744773 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sun, 1 Mar 2026 18:20:47 +0100 Subject: [PATCH 2/2] Fix print mode as well --- src/generators/legacy-html/assets/style.css | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/generators/legacy-html/assets/style.css b/src/generators/legacy-html/assets/style.css index 5eaf8639..e066c3b3 100644 --- a/src/generators/legacy-html/assets/style.css +++ b/src/generators/legacy-html/assets/style.css @@ -1014,9 +1014,6 @@ kbd { filter: invert(1); } -:root:not(.has-js) .copy-button { - display: none; -} .copy-button { float: right; outline: none; @@ -1043,6 +1040,10 @@ kbd { background-color: var(--green2); } +:root:not(.has-js) .copy-button { + display: none; +} + @supports (aspect-ratio: 1 / 1) { .js-flavor-toggle { height: 1.5em; @@ -1125,7 +1126,13 @@ kbd { border-bottom: 1px solid var(--color-text-primary); } - .js-flavor-toggle ~ * { + .js-flavor-toggle + * { + margin-bottom: 2rem; + padding-bottom: 2rem; + border-bottom: 1px solid var(--color-text-primary); + } + + .js-flavor-toggle ~ :not(.copy-button) { display: block !important; background-position: top right; background-size: 142px 20px; @@ -1139,6 +1146,10 @@ kbd { .js-flavor-toggle ~ .mjs { background-image: url('./js-flavor-esm.svg'); } + + .copy-button { + display: none; + } } html.dark-mode .shiki,