fix: hide copy button when JS is disabled and when printing#635
Open
fix: hide copy button when JS is disabled and when printing#635
Conversation
And move the button to the bottom of the box to align with previous tooling
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #635 +/- ##
=======================================
Coverage 72.47% 72.47%
=======================================
Files 144 144
Lines 12604 12604
Branches 872 872
=======================================
Hits 9135 9135
Misses 3464 3464
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
| File | Base | Head | Diff |
|---|---|---|---|
orama-db.json |
8.04 MB | 8.04 MB | +1.78 KB (+0.02%) |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the copy button in the legacy-html generator so it is hidden when JavaScript is disabled (via the existing :root:not(.has-js) CSS pattern). It also adjusts the layout so the button moves to the bottom of the code box, aligning with previous tooling behavior.
Changes:
- Adds a CSS rule to hide
.copy-buttonwhen thehas-jsclass is absent from:root - Removes
float: leftfrompre > codeto allow the button to render below (rather than beside) the code content - Adjusts
.copy-buttonmargins: removesmargin-top: -2px(no longer needed) and convertsmargin-rightfrom10pxto0.2rem
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
avivkeller
approved these changes
Mar 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
And move the button to the bottom of the box to align with previous tooling
Validation
mainRelated Issues
Check List
node --run testand all tests passed.node --run format&node --run lint.