Skip to content

fix(docs-infra): avoid code copy button overlap#69055

Closed
KirtiRamchandani wants to merge 1 commit into
angular:mainfrom
KirtiRamchandani:fix/code-block-copy-overlap
Closed

fix(docs-infra): avoid code copy button overlap#69055
KirtiRamchandani wants to merge 1 commit into
angular:mainfrom
KirtiRamchandani:fix/code-block-copy-overlap

Conversation

@KirtiRamchandani

Copy link
Copy Markdown
Contributor

PR Checklist

PR Type

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Headered docs code blocks position the copy-source button over the scrollable code area. On narrow viewports or horizontally scrollable snippets, code can slide underneath the button and become obscured.

Issue Number: Fixes #68534

What is the new behavior?

For code blocks with a header, the copy button is positioned in the header band instead of over the code content. The header also reserves inline space for the button so long filenames do not run underneath it. Headerless snippets keep their existing button placement.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Tests run:

  • npx --yes [email protected] --check adev/shared-docs/styles/docs/_code.scss
  • npx --yes [email protected] --no-source-map --style=expanded adev/shared-docs/styles/docs/_code.scss
  • git diff --check HEAD~1..HEAD

Local note: the repository pnpm wrapper failed before running formatter commands on this Windows checkout because the pnpm executable was not available on PATH, so the same Prettier version was run directly with npx.

Move copy buttons for headered docs code blocks into the header area and reserve header padding so code content no longer scrolls underneath the control on narrow viewports.

Fixes angular#68534
@pullapprove pullapprove Bot requested a review from atscott June 1, 2026 17:16
@KirtiRamchandani

Copy link
Copy Markdown
Contributor Author

Closing this as a duplicate of #69030, which already fixes #68534 with the same scoped code-block copy button change and has the checks further along.

@angular-robot angular-robot Bot added the area: docs-infra Angular.dev application and infrastructure label Jun 1, 2026
@ngbot ngbot Bot added this to the Backlog milestone Jun 1, 2026
@angular-automatic-lock-bot

Copy link
Copy Markdown

This pull request has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Jul 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: docs-infra Angular.dev application and infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copy button overlaps code content in code blocks on smaller screens

1 participant