Uh oh!
There was an error while loading. Please reload this page.
init: add skip-to-main-content shortcut - #7390
Conversation
Signed-off-by: Yaten Dhingra <yaten598@gmail.com>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
I think currently on pressing Edit: Sorry, will not ping 👍 |
AugustinMauroy
commented
Jan 7, 2025
WOW stop pinging everyone ! we (website team) receive notification when there are changes on repo. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Signed-off-by: Yaten Dhingra <yaten598@gmail.com>
Signed-off-by: Yaten Dhingra <yaten598@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Signed-off-by: Yaten Dhingra <yaten598@gmail.com>
| return ( | ||
| <div> | ||
| <a className={classNameOnTabPress} href="#main"> |
There was a problem hiding this comment.
Anchor href is not working, main element is missing the id attribute.
There was a problem hiding this comment.
This href won't work as of now, because I just set it randomly to #main, I wanted to clarify that to what section the user must be directed to on clicking this button?
There was a problem hiding this comment.
I believe It should redirect to main indeed
There was a problem hiding this comment.
For this, is there a main class present in the pages? Ig not?
There is this <main/> tag present in the about page, just for example.
There was a problem hiding this comment.
Sorry, I don't understand what you saying
There was a problem hiding this comment.
I was trying to say that on any page, since we're redirecting to #main, there is no such class as #main on any page, so where should the user be redirected?
There was a problem hiding this comment.
User should be "redirected" to main, layouts lives on apps/site/layouts.
Uh oh!
There was an error while loading. Please reload this page.
Signed-off-by: Yaten Dhingra <yaten598@gmail.com>
yaten2302
commented
Jan 10, 2025
I've pushed a minor change(typo). Just wanted to ask, that could anyone please guide regarding these points, I was having a few doubts: |
Signed-off-by: Yaten Dhingra <yaten598@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
Signed-off-by: Yaten Dhingra <yaten598@gmail.com>
aduh95
commented
Jan 22, 2025
I've tried to pull that PR on top of |
yaten2302
commented
Jan 23, 2025
2025-01-23.11-09-38.mp4I've shared a screen recording for the same, is this behavior not being shown on your side? I just checked that in the deployment also it's showing this. |
aduh95
commented
Jan 23, 2025
No even running from the DevTools My steps are: git fetch https://github.com/nodejs/nodejs.org.git HEAD
git reset FETCH_HEAD --hard
curl -L https://github.com/nodejs/nodejs.org/pull/7390.patch | git am
npm ci
npm run dev |
yaten2302
commented
Jan 23, 2025
| 'blog-category': BlogLayout, | ||
| download: DownloadLayout, | ||
| article: ArticlePageLayout, | ||
| skipToContent: WithNavBar, |
There was a problem hiding this comment.
I don't think skipToContent is a page layout, IMO it is a feature in layouts
There was a problem hiding this comment.
Someone mentioned about this in previous suggestions, that it needs to be added in withLayout.tsx, should I remove this?
There was a problem hiding this comment.
I think you are talking about this comment; #7390 (comment)
@araujogui As far as I understand, the suggestion is to move the skip to content button here, not add it as a layout right? 🤔
There was a problem hiding this comment.
I think you are talking about this comment; #7390 (comment)
@araujogui As far as I understand, the suggestion is to move the skip to content button here, not add it as a layout right? 🤔
Yep, that's what I meant
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| | 'download' | ||
| | 'article'; | ||
| | 'article' | ||
| | 'skipToContent'; |
There was a problem hiding this comment.
Similarly, IMO there should be no skip to content layout
Signed-off-by: Yaten Dhingra <yaten598@gmail.com>
aduh95
commented
Jan 24, 2025
It looks like we don't have any element with a I've also tried to use the website using VoiceOver, it seems completely impossible to access the menu from there, which is pretty bad, but I guess I'll open a separate issue for that. |
yaten2302
commented
Jan 24, 2025
Yes, I think, the desired behavior is such that on clicking |
aduh95
commented
Jan 24, 2025
As you can read in https://www.w3.org/TR/WCAG20-TECHS/G1.html#G1-tests, in order to fix the linked issue the following checks need to pass:
Currently those check fail; adding the |
yaten2302
commented
Jan 25, 2025
May I create an issue for the same? |
yaten2302
commented
Jan 25, 2025
By the time this issue gets fixed, I would like to work upon some other issues too! And this PR can be kept on hold for a while till the time the main id is added in all pages. |
ovflowd
left a comment
There was a problem hiding this comment.
I'd ask to first apply the suggestions made from other users. I appreciate that you're iterating over our feedback and appreciate your time here.
Having that said, I don't think this can land as it is right now. The button is simply hiding other content and overlapping with it in a non-productive manner.
I'd recommend using the small variant of our Button, and making it floating on the bottom right (position: fixed) or something of sort.
That said, I don't really think our pages need a "skip to content" Button -- Our pages are already designed in a way that the content is always already present even when scroll is zeroed. It is a very responsive design and that does not require a button to skip to content, since again, the content is always visible.
I'm -1 on this change.
For example the download page could definitely benefit form it, it takes a long while to get to the download button using VoiceOver – but |
ovflowd
commented
Jan 26, 2025
Which download page? The download page renders all in one screen without even needing to scroll |
ovflowd
commented
Jan 26, 2025
Also the whole downloads page is the main content; A skip to main content there just does not make any sense here. |
aduh95
commented
Jan 26, 2025
VoiceOver is a screen reader built into Apple OSes (macOS, iOS, tvOS, watchOS, iPadOS) designed to increase accessibility for blind and low-vision users, as well as for users with dyslexia. The fact that all the content is visible without scrolling is irrelevant for folks who can't see |
ovflowd
commented
Jan 26, 2025
Are we talking about the same thing? I'm talking about a skip to content button. That doesn't make sense to be rendered nor added. We can detect by CSS queries if the user is using a VoiceOver tool, in those situations if you believe any extra accessibility accessory needs to be added here, I'd like to follow standards proposed by a11y. |
aduh95
commented
Jan 26, 2025
As you can read in #7220 description (or directly in https://www.w3.org/TR/WCAG20-TECHS/G1.html#G1-tests), the "Skip to content" button is an a11y best practice. Anyway, your point of "we may actually not need it" is not invalid, I'm not disputing it – though I'd encourage you to try browsing the Download page with a screen reader, getting to the important links takes a frustrating long time. |
ovflowd
commented
Jan 26, 2025
Noted. I believe this is something tricky. I would consider closing this PR and open an discussion first so we can properly discuss about how to approach this. Maybe for key/essential pages we can have invisible elements that are rendered for screen readers, that's also a common practice. |
yaten2302
commented
Jan 27, 2025
Should I close this PR for now? Maybe after some discussion, a new PR can be created? |
ovflowd
commented
Jan 28, 2025
I think that would be the best move for the time being. I appreciate your time here 🙏 |
aduh95
commented
Jan 28, 2025
Another move would be to change this PR to only add the button to the |
yaten2302
commented
Jan 30, 2025
Thanks ovflowd 👍 |


Description
This PR adds a
skip to main contentbutton (initially hidden), when the user pressesTab(for windows), the button is visible and the user can then move directly to the main content of the page.Related Issues
Fixes#7220
Check List
npm run formatto ensure the code follows the style guide.npm run testto check if all tests are passing.npx turbo buildto check if the website builds without errors.