Skip to content

Commit

Permalink
fix: improve accessibility per Lighthouse
Browse files Browse the repository at this point in the history
  • Loading branch information
zlataovce committed Dec 2, 2023
1 parent ad208d6 commit ecb6cdd
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ fun FlowContent.footerComponent() {
+"Built with lots of coffee and ❤️, for people by people."
}
a(href = "https://github.com/zlataovce/takenaka", classes = "icon-link") {
attributes["aria-label"] = "GitHub"
unsafe {
+"""<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"/></svg>"""
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ fun GenerationContext.classPage(
}

val klassDeclaration = klass.formatDescriptor(friendlyKlassName, remapper)

lang = "en"
head {
versionRootComponent(rootPath = versionRootPath)
defaultResourcesComponent(rootPath)
Expand Down Expand Up @@ -105,6 +107,7 @@ fun GenerationContext.classPage(
}
if (hash != null) {
a(classes = "history-icon", href = "${rootPath}history/$hash.html") {
attributes["aria-label"] = "History"
unsafe {
+"""<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>"""
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ fun GenerationContext.historyPage(node: ClassAncestryNode): Document = createHTM
}
}

lang = "en"
head {
defaultResourcesComponent(rootPath = "../")
if (generator.config.emitMetaTags) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ private val PROTOCOL_REGEX = "^[a-z-]+://.+$".toRegex()
* @return the generated document
*/
fun GenerationContext.licensePage(workspace: VersionedWorkspace, licenses: Map<String, License>): Document = createHTMLDocument().html {
lang = "en"
head {
versionRootComponent()
defaultResourcesComponent(rootPath = "../")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import org.w3c.dom.Document
* @return the generated document
*/
fun GenerationContext.overviewPage(workspace: VersionedWorkspace, packages: Set<String>): Document = createHTMLDocument().html {
lang = "en"
head {
versionRootComponent()
defaultResourcesComponent(rootPath = "../")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import org.w3c.dom.Document
fun GenerationContext.packagePage(workspace: VersionedWorkspace, packageName: String, classes: Map<ClassType, Set<String>>): Document = createHTMLDocument().html {
val packageName0 = packageName.fromInternalName()

lang = "en"
head {
val versionRootPath = getPackageRelativeVersionRoot(packageName0)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import org.w3c.dom.Document
* @return the generated document
*/
fun GenerationContext.versionsPage(welcomeMessage: String?, versions: Map<Version, List<String>>): Document = createHTMLDocument().html {
lang = "en"
head {
defaultResourcesComponent(rootPath = "")
title(content = "mappings")
Expand Down
8 changes: 4 additions & 4 deletions generator/web/src/main/resources/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,19 @@
--bg: white;
--nav: #f2f3f5;
--nav-item: black;
--nav-item-muted: #6c757d;
--search: #dbdcde;
--nav-item-muted: #44494e;
--search: #e2e2e4;
--search-results: #f2f3f5;
--search-hover: #d1d2d4;
--search-results-hover: #dbdcde;
--button: #dbdcde;
--button: #e2e2e4;
--button-hover: #d1d2d4;
--link: #0c65f6;
--link-hover: #004ac2;
--search-title: #222325;
--search-subtitle: #51555e;
--code-block: #f2f3f5;
--input-placeholder: #71717a;
--input-placeholder: #44494e;
}

* {
Expand Down

0 comments on commit ecb6cdd

Please sign in to comment.