Repository navigation
Docs: add a <main> landmark to the homepage and the 404 page - #43105
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
julien-deramond
marked this pull request as ready for review
October 16, 2026 17:05
4 of 10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The homepage and the 404 page have no
<main>landmark. axe'slandmark-one-mainrule fails on both, and the "Skip to main content" link lands on a plaindivon the homepage and on nothing at all on the 404 page.Every other page gets its
<main>from its layout through themainslot.@twbs/bui'sBaseLayoutis supposed to wrap pages that don't fill that slot in<main id="content">, but ourBaseLayoutalways fills it, so that fallback never runs and the page content is rendered bare. Now ourBaseLayoutrenders<main id="content">itself in that case, with the page'soverrides.mainattributes. The masthead drops its ownid="content", and the 404 page drops theid: 'content'it passed, since the layout sets it.Closes #43045.
The homepage doesn't change: the screenshots before and after are identical at 1280px and 390px. The 404 page does, because its
overrides.main(my-auto p-5) was never applied while no<main>was rendered. Withd-flex flex-column min-vh-100on the body, the message is now centered vertically and the footer sits at the bottom, as the page's markup intended.I fixed the layout instead of turning the masthead into
<main>(as #43102 does), because that only fixes the homepage and leaves the 404 page without a landmark. In the fallback,id: 'content'comes before the spread ofmainProps, so a page that passes its ownidreplaces it instead of printing a secondidattribute.In the built site, every page rendered by
BaseLayoutnow has exactly one<main>. The few pages still without one are the standalone snippet examples, which have their own markup. I didn't run axe, Lighthouse, or a screen reader.Live previews
🤖 Generated with Claude Code