Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table of Contents: Make whole header clickable on small and medium screens #556

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

adamwoodnz
Copy link
Contributor

@adamwoodnz adamwoodnz commented Jan 11, 2024

Fixes #547

I've decided to use absolute positioning to make the toggle button fill the header, so that the H2 doesn't need to be hidden and removed from the markup, thus maintaining the page structure. No visual changes.

If this approach is acceptable I'll follow on with the same for the Chapter List, in the Developer Resources repo. For now that remains a separate UI component, as there is further discussed functionality for it, like the ability to collapse left.

Testing

The ToC block is used on Documentation and Developer Resources. Using one of those local environments, or sandbox, switch mu-plugins to this branch.

  1. Open pages using the ToC, eg. Code Reference, Block Editor or Optimization
  2. On screens < 1200px wide with the ToC inline, the toggle button should fill the header.
  3. Expand and contract the ToC
  4. Check for regressions on large screens

@adamwoodnz adamwoodnz requested a review from ryelle January 11, 2024 03:02
@adamwoodnz adamwoodnz self-assigned this Jan 11, 2024
@adamwoodnz adamwoodnz added the Redesign Related to the wordpress.org redesign project label Jan 11, 2024
@adamwoodnz adamwoodnz force-pushed the fix/547-toc-header-clickable branch from a9f08ce to 5539120 Compare January 11, 2024 04:25
@adamwoodnz adamwoodnz marked this pull request as ready for review January 11, 2024 04:35
Copy link
Contributor

@StevenDufresne StevenDufresne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me.

@renintw
Copy link
Contributor

renintw commented Jan 11, 2024

Followed the testing steps and it worked for me 👍

Copy link
Contributor

@ryelle ryelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍🏻

@adamwoodnz adamwoodnz merged commit 29ebd20 into trunk Jan 11, 2024
2 checks passed
@adamwoodnz adamwoodnz deleted the fix/547-toc-header-clickable branch January 11, 2024 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Table of Contents Redesign Related to the wordpress.org redesign project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ToC interaction target should be larger
4 participants