Skip to content

Website: reveal heading anchor links on hover#1740

Open
ryanio wants to merge 1 commit into
ethereum:masterfrom
ryanio:website-hover-anchor-links
Open

Website: reveal heading anchor links on hover#1740
ryanio wants to merge 1 commit into
ethereum:masterfrom
ryanio:website-hover-anchor-links

Conversation

@ryanio
Copy link
Copy Markdown
Contributor

@ryanio ryanio commented May 12, 2026

Summary

Headings in ERC content are already wrapped in <a class=\"anchor-link\" href=\"#…\"> by the anchor_headings.html include, 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 to h2h6 inside .page-content, hides the anchor by default, and reveals it on heading hover (GitHub-style) or anchor focus (keyboard accessibility).

  • h1 is 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 it
  • Layout space is reserved with visibility: hidden rather than display: none, so headings don't shift when the icon appears
  • Pure CSS change, no markup or include changes
  • Matching change opened against ethereum/EIPs, since the two repos share this layout code

Test plan

  • Hover an ##/### heading in any ERC page — the link icon appears to the left of the heading text
  • Move cursor away — icon hides
  • Click the icon — URL updates to #section-id
  • Tab through the page — anchor link receives focus and becomes visible
  • Page-title <h1> is unchanged (still shows Discuss/Source icons only)

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.
@ryanio ryanio requested a review from eip-review-bot as a code owner May 12, 2026 17:11
@eip-review-bot
Copy link
Copy Markdown
Collaborator

eip-review-bot commented May 12, 2026

File assets/css/style.scss

Requires 2 more reviewers from @g11tech, @jochem-brouwer, @lightclient, @samwilsn, @xinbenlv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants