Skip to content

Fix copy button overlapping code on small screens#51

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-copy-button-overlapping-code
Draft

Fix copy button overlapping code on small screens#51
Copilot wants to merge 2 commits intomainfrom
copilot/fix-copy-button-overlapping-code

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

The absolutely-positioned copy button was rendering over the code content on narrow viewports because pre.highlight had no right padding to reserve space for it.

Changes

  • assets/index.css — add pr-16 (4rem) to pre.highlight, pushing code content clear of the button's ~60px footprint (right: 0.25rem + margin-right: 1rem + padding + icon)
  • dist/style.*.css — apply the equivalent padding-right:4rem directly to the compiled asset
/* before */
pre.highlight {
    @apply relative min-h-12;
}

/* after */
pre.highlight {
    @apply relative min-h-12 pr-16;
}
Original prompt

This section details on the original issue you should resolve

<issue_title>The copy code button is overlapping the code on smaller screens. </issue_title>
<issue_description>With the newly added copy code button a new bug was introduced where said button overlaps the actual code example. As you can see in the attached image.

IMG_5951
</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…ight to pre.highlight

Co-authored-by: DannyvdSluijs <618940+DannyvdSluijs@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix overlap of copy code button on smaller screens Fix copy button overlapping code on small screens Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The copy code button is overlapping the code on smaller screens.

2 participants