fix(docs-infra): avoid code copy button overlap#69055
Closed
KirtiRamchandani wants to merge 1 commit into
Closed
Conversation
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
Contributor
Author
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
PR Checklist
PR Type
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?
Other information
Tests run:
npx --yes [email protected] --check adev/shared-docs/styles/docs/_code.scssnpx --yes [email protected] --no-source-map --style=expanded adev/shared-docs/styles/docs/_code.scssgit diff --check HEAD~1..HEADLocal note: the repository
pnpmwrapper failed before running formatter commands on this Windows checkout because thepnpmexecutable was not available on PATH, so the same Prettier version was run directly withnpx.