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

[Site][Accessibility] Proper headings defined on every page across docs and PWABuilder.com #4478

Merged
merged 8 commits into from
Oct 27, 2023
11 changes: 9 additions & 2 deletions apps/pwabuilder/src/script/pages/app-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export class AppReport extends LitElement {
"file_handlers": "Be a default handler for certain filetypes with file_handlers",
"handle_links": "Open links as an app with handle_links",
"protocol_handlers": "Create a custom protocol_handler",
"edge_side_panel": "Increase reach by partcipating in the edge_side_panel",
"edge_side_panel": "Increase reach by participating in the edge_side_panel",
"widgets": "Increase reach with widgets"
}

Expand Down Expand Up @@ -498,6 +498,10 @@ export class AppReport extends LitElement {
margin: 0;
}

.visually-hidden {
font-size: 0;
}

#site-url {
text-overflow: ellipsis;
overflow: hidden;
Expand Down Expand Up @@ -2880,7 +2884,10 @@ export class AppReport extends LitElement {
${this.proxyLoadingImage || this.appCard.iconURL.length === 0 ? html`<span class="proxy-loader"></span>` : html`<img src=${this.appCard.iconURL} alt=${this.appCard.iconAlt} />`}
</div>
<div id="card-info" class="flex-row">
<h1 id="site-name">${this.appCard.siteName}</h1>
<h1 id="site-name">
${this.appCard.siteName}
<span class="visually-hidden" aria-live="polite">Report card page for ${this.appCard.siteName}</span>
</h1>
<p id="site-url">${this.appCard.siteUrl}</p>
<p id="app-card-desc" class="app-card-desc-desktop">${this.truncateString(this.appCard.description)}</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,10 @@ export default css`
font-size: 14px;
}

#words p:nth-child(1) {
#words h1 {
font-size: 24px;
font-weight: 700;
margin: 0;
}
#words p:nth-child(2) {
width: 55%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export function renderAppCard(
/>
</div>
<div id="words">
<p>${appCard.siteName}</p>
<h1>${appCard.siteName}</h1>
<p>${appCard.siteUrl}</p>
<p class="app-desc">${appCard.description}</p>
</div>
Expand Down Expand Up @@ -315,7 +315,7 @@ export function renderAppCard(
/>
</div>
<div id="words">
<p>${appCard.siteName}</p>
<h1>${appCard.siteName}</h1>
<p>${appCard.siteUrl}</p>
<p class="app-desc">${appCard.description}</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/sidebarGeneration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function constructMenuItemLineString(article: Article): string {
}

function constructHeaderLineString(childMenu: ChildMenu): string {
return `\n\n\- **${childMenu.header}**`;
return `\n\n- <h2>${childMenu.header}</h2> \n`;
}

function constructTopLevelNavString(activeHeader: string): string {
Expand Down
Loading