Website: reveal heading anchor links on hover#1740
Open
ryanio wants to merge 1 commit into
Open
Conversation
The anchor_headings include already wraps h1-h6 in content with <a class="anchor-link" href="#…"> tags, but the link icon was only painted while hovering a 16x16 invisible patch in the left margin, so most readers never discovered the feature. Scope the rule to h2-h6 inside .page-content (skipping the page-title h1, which already carries Discuss/Source icons), make the icon visible when the heading itself is hovered, and also reveal it on keyboard focus for accessibility.
Collaborator
File
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Headings in ERC content are already wrapped in
<a class=\"anchor-link\" href=\"#…\">by theanchor_headings.htmlinclude, but the link icon is only painted while the cursor is inside an invisible 16×16 patch in the left margin — so the anchor feature has been effectively undiscoverable. This PR scopes the rule toh2–h6inside.page-content, hides the anchor by default, and reveals it on heading hover (GitHub-style) or anchor focus (keyboard accessibility).h1is skipped intentionally — the page-title<h1 class=\"page-heading\">already carries Discuss/Source icons, so adding a third icon on that line would just clutter itvisibility: hiddenrather thandisplay: none, so headings don't shift when the icon appearsTest plan
##/###heading in any ERC page — the link icon appears to the left of the heading text#section-id<h1>is unchanged (still shows Discuss/Source icons only)