json-schema-org / json-schema-org/website
🐛 Bug: Copy Button & Schema Label Missing Top/Right Margin in Code Blocks
Nobody has claimed this yet.
- 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
- Navigate to the "The basics" page in the Docs section.
- Observe any code block (e.g., the empty schema
{}block or the data examples below it). - 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
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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