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

Accessibility: Add skip to content button #586

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

yannicka
Copy link
Contributor

@yannicka yannicka commented Feb 2, 2024

Don't push it as it is: firstly, I don't know if the naming is right or if I'm placing the elements in the right place (in terms of both HTML and CSS). Secondly, on some pages, like the category page for example, clicking on the link redirects to /[object History]. I haven't yet been able to find out why, so if anyone has any ideas, I'd be grateful for any help.

Questions Answers
Description? Add a "Skip to content" button for accessibility.
Type? new feature
BC breaks? no
Deprecations? no
Fixed ticket? No, but help #251
Sponsor company N/A
How to test? Load a page and press "tab"

Screenshot:
image

@yannicka yannicka marked this pull request as draft February 2, 2024 22:23
@yannicka yannicka changed the title WIP: Accessibility: Add skip to content button Accessibility: Add skip to content button Feb 2, 2024
@Hlavtox
Copy link
Contributor

Hlavtox commented Feb 23, 2024

I don't know what to think of this, I have never seen a button like this in my life. 🤷‍♂️

@yannicka
Copy link
Contributor Author

I don't know what to think of this, I have never seen a button like this in my life. 🤷‍♂️

If you press "tab" on websites, this link will be displayed.

Example on GitHub:
image

On gov.uk:
image

On wordpress.org:
image

Etc.

https://css-tricks.com/how-to-create-a-skip-to-content-link/

Of course, my PR is useless as long as these bugs exist.

@Hlavtox
Copy link
Contributor

Hlavtox commented Feb 23, 2024

@yannicka Cool!!! I learned something new. :-)

Well, I think the bug with the Object-history thing is the same issue as with the profiler right? PrestaShop/PrestaShop#33260

@yannicka
Copy link
Contributor Author

yannicka commented Feb 23, 2024

@yannicka Cool!!! I learned something new. :-)

Well, I think the bug with the Object-history thing is the same issue as with the profiler right? PrestaShop/PrestaShop#33260

Great :)

Yes, the issue seems very similar if not identical.

@dennispw
Copy link
Contributor

Where does the "content" start in this case? On catalog pages (categories, search, etc.) I guess the content would be the products? What if a category don't have any products but sub categories with products in them? Where is the "content" on the start page?

This will become very theme and module dependent. Even with hummingbird and standard PS modules on the start page (as an example) they can freely change positions and/or activate/deactivate modules.

I'm not opposed to the idea as such, but I think it's a quirky one to implement correctly since the very nature of PrestaShop is customizability the "content" in this case can (and will) different for different shops.

@yannicka
Copy link
Contributor Author

The link depends on the theme, as it leads to the tag with the id wrapper. But since we're in the theme itself, I don't see any problem with that.

The content may indeed be different between pages, but it's often considered to be what comes after the header. Which is the case here, the tag is just after the header:

<header id="header" class="header">
{block name='header'}
{include file='_partials/header.tpl'}
{/block}
</header>
<main id="wrapper" class="wrapper">
{hook h="displayWrapperTop"}
{block name='breadcrumb'}
{include file='_partials/breadcrumb.tpl'}
{/block}

On some sites, the skip link is more complex and may contain several links to take you to different places, but this would require more work.

image

As it stands, considering that the content is always in the wrapper tag seems fine to me, since we're not trying to avoid the page title or anything else. So it works just as well on the home page as on a category page, a product page or any other page.

@nicosomb nicosomb mentioned this pull request May 16, 2024
28 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready for review
Development

Successfully merging this pull request may close these issues.

3 participants