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

Prototype for making it easier to link to specific sections by headings #1004

Closed
wants to merge 14 commits into from

Conversation

NickColley
Copy link
Contributor

@NickColley NickColley commented Jul 30, 2019

I'm opening this as a result of my messing around with different approaches.

The main controversial aspect of this approach is that it's intentionally pointer (desktop mouse) only.

You cannot keyboard navigate to the headings.

This is because I felt it would be noisy to duplicate the headings with links.

On pages such as typography you'd also get headings and the sub navigation with the same URL.

If you're looking to navigate to a heading in assistive technologies you could already use the overview for headings and headings shortcuts, so it feels like adding these additionally as links is extra noise.

I'm not sure if this is the right decision which is why I'm opening this as a prototype for discussion.

Features

  • Scales with heading size automatically
  • Can be added to non markdown generated content

Screenshots

Screen Shot 2019-07-30 at 16 04 23

Closes #425

@govuk-design-system-ci
Copy link
Collaborator

govuk-design-system-ci commented Jul 30, 2019

You can preview this change here:

Built with commit 96b89ed

https://deploy-preview-1004--govuk-design-system-preview.netlify.com

</td>
</tr>
{% endfor %}
<tr>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This needs to be flattened so the HTML doesnt get confused, not sure another way.

@NickColley
Copy link
Contributor Author

If people like this approach I can tidy up the code and get it ready for review.

@NickColley NickColley changed the title Prototype for anchored headings Prototype for making it easier to link to specific sections by headings Jul 31, 2019
@NickColley
Copy link
Contributor Author

I talked to @DebsDee and we want to explore being more consistent with the H2 side navigation before doing something like this as we're concerned about the accessibility impact.

@NickColley NickColley closed this Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make it easy to link to sections of a page
2 participants