mirror of
https://github.com/jackyzha0/quartz
synced 2026-11-27 22:14:40 +01:00
fix(a11y): page frames use <main> and <aside> landmarks
This commit is contained in:
4 files changed
+15
-10
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": patch
|
||||
---
|
||||
|
||||
The page frames mark their regions for assistive technology: the centre column is a `<main>` (it was a `div.center`; the classes are unchanged) and the default frame's sidebars are `<aside>` elements. Screen readers can jump to the page's content, and the page looks the same.
|
||||
@@ -24,12 +24,12 @@ export const DefaultFrame: PageFrame = {
|
||||
}: PageFrameProps) {
|
||||
return (
|
||||
<>
|
||||
<div class="left sidebar" data-sidebar-mode={sidebars?.left ?? "fit"}>
|
||||
<aside class="left sidebar" data-sidebar-mode={sidebars?.left ?? "fit"}>
|
||||
{left.map((BodyComponent) => (
|
||||
<BodyComponent {...componentData} />
|
||||
))}
|
||||
</div>
|
||||
<div class="center">
|
||||
</aside>
|
||||
<main class="center">
|
||||
<div class="page-header">
|
||||
<Header {...componentData}>
|
||||
{header.map((HeaderComponent) => (
|
||||
@@ -49,12 +49,12 @@ export const DefaultFrame: PageFrame = {
|
||||
<BodyComponent {...componentData} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div class="right sidebar" data-sidebar-mode={sidebars?.right ?? "fit"}>
|
||||
</main>
|
||||
<aside class="right sidebar" data-sidebar-mode={sidebars?.right ?? "fit"}>
|
||||
{right.map((BodyComponent) => (
|
||||
<BodyComponent {...componentData} />
|
||||
))}
|
||||
</div>
|
||||
</aside>
|
||||
{footer.map((FooterComponent) => (
|
||||
<FooterComponent {...componentData} />
|
||||
))}
|
||||
|
||||
@@ -23,7 +23,7 @@ export const FullWidthFrame: PageFrame = {
|
||||
}: PageFrameProps) {
|
||||
return (
|
||||
<>
|
||||
<div class="center full-width">
|
||||
<main class="center full-width">
|
||||
<div class="page-header">
|
||||
<Header {...componentData}>
|
||||
{header.map((HeaderComponent) => (
|
||||
@@ -43,7 +43,7 @@ export const FullWidthFrame: PageFrame = {
|
||||
<BodyComponent {...componentData} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
{footer.map((FooterComponent) => (
|
||||
<FooterComponent {...componentData} />
|
||||
))}
|
||||
|
||||
@@ -13,9 +13,9 @@ export const MinimalFrame: PageFrame = {
|
||||
render({ componentData, pageBody: Content, footer }: PageFrameProps) {
|
||||
return (
|
||||
<>
|
||||
<div class="center minimal">
|
||||
<main class="center minimal">
|
||||
<Content {...componentData} />
|
||||
</div>
|
||||
</main>
|
||||
{footer.map((FooterComponent) => (
|
||||
<FooterComponent {...componentData} />
|
||||
))}
|
||||
|
||||
Reference in new issue
Block a user