From 70b03eb56ee89d87df18d309e15945e38be2d07d Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Tue, 10 Apr 2018 22:08:14 -0700 Subject: [PATCH] fix headings for timelines (#67) Adds an sr-only class to make this easier in the future. Also fixes a missing aria-label. Fixes #44 --- routes/_components/compose/ComposeAuthor.html | 3 ++- routes/_components/compose/ComposeBox.html | 3 +++ routes/_components/timeline/Timeline.html | 4 +++- scss/global.scss | 12 ++++++++++++ templates/2xx.html | 2 +- 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/routes/_components/compose/ComposeAuthor.html b/routes/_components/compose/ComposeAuthor.html index 3a414cf..d177dce 100644 --- a/routes/_components/compose/ComposeAuthor.html +++ b/routes/_components/compose/ComposeAuthor.html @@ -1,5 +1,6 @@ + class="compose-box-avatar" + aria-label="Profile for {{verifyCredentials.display_name || verifyCredentials.acct}}"> diff --git a/routes/_components/compose/ComposeBox.html b/routes/_components/compose/ComposeBox.html index b03e5a1..35349e1 100644 --- a/routes/_components/compose/ComposeBox.html +++ b/routes/_components/compose/ComposeBox.html @@ -1,3 +1,6 @@ +{{#if realm === 'home'}} +

Compose toot

+{{/if}}
{{#if contentWarningShown}} diff --git a/routes/_components/timeline/Timeline.html b/routes/_components/timeline/Timeline.html index e2cf615..d05fb83 100644 --- a/routes/_components/timeline/Timeline.html +++ b/routes/_components/timeline/Timeline.html @@ -1,6 +1,6 @@ +

{{label}}

@@ -115,6 +115,8 @@ return `Account #${timelineValue} on ${$currentInstance}` case 'list': return `List #${timelineValue} on ${$currentInstance}` + case 'notifications': + return `Notifications for ${$currentInstance}` } }, timelineType: (timeline) => { diff --git a/scss/global.scss b/scss/global.scss index af506fb..f5db7db 100644 --- a/scss/global.scss +++ b/scss/global.scss @@ -178,4 +178,16 @@ textarea { .ellipsis::after { content: "\2026"; +} + +/* via https://stackoverflow.com/a/19758620 */ +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; } \ No newline at end of file diff --git a/templates/2xx.html b/templates/2xx.html index be08161..60c5d7a 100644 --- a/templates/2xx.html +++ b/templates/2xx.html @@ -17,7 +17,7 @@