json-schema-org / json-schema-org/website

🐛 Bug: Copy Button & Schema Label Missing Top/Right Margin in Code Blocks

Open
#2,284 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🐛 Bug Status: Stale Status: Triage
Dominant language
HTML
Stars
169
Forks
484
Avg merge
2d 2h
Merged PRs (30d)
6

Description

Describe the bug

The copy icon (📋) and the "schema" / "data" label that appear in code blocks are positioned fixed/sticky to the top-right corner without any margin from the top and right edges of the code block container. This causes them to appear flush against the border, which looks visually unpolished and can also partially overlap the code content.

Steps To Reproduce
  1. Navigate to the "The basics" page in the Docs section.
  2. Observe any code block (e.g., the empty schema {} block or the data examples below it).
  3. Notice the copy icon and "schema"/"data" label are pinned with no spacing from the top-right corner of the code block.
Expected Behavior

The copy button and label should have consistent margin/padding from the top and right edges of the code block — e.g., margin-top: 8px and margin-right: 8px (or equivalent) — so they appear visually balanced and do not touch the border.

Actual Behaviour

The copy button and label are flush to the top-right with no visible margin, making the UI feel cramped.

Suggested Fix

Add top and right margin/padding to the sticky copy button and badge container inside code blocks:

.code-block-actions {
  margin-top: 8px;
  margin-right: 8px;
}
Device Information [optional]
  • OS:MacOS
  • Browser:Chrome
  • version:
Screenshots
Image
Are you working on this issue?

Yes

Do you think this work might require an [Architectural Decision Record (ADR)]? (significant or noteworthy)

Yes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the Docs “The basics” page and inspect the code blocks, focusing on the sticky copy button and the “schema”/“data” label and the suggested .code-block-actions styles. Done means both elements have consistent top and right spacing without touching the code-block border or overlapping its content; verify this visually in the documented examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, html
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.