Final A11y fixes and feedback

This commit is contained in:
Anthony Bullard 2024-12-18 08:46:53 -06:00
parent 76b61e6c55
commit 0cb8de5d67
No known key found for this signature in database
2 changed files with 88 additions and 46 deletions

View file

@ -29,7 +29,7 @@
</svg>
</a>
<!-- Package Name -->
<button class="menu-toggle">
<button class="menu-toggle" aria-label="Toggle sidebar">
<svg viewBox="0 0 72 72" id="emoji" xmlns="http://www.w3.org/2000/svg" fill="currentcolor">
<g id="SVGRepo_iconCarrier">
<g id="color"></g>
@ -51,13 +51,15 @@
</svg>
</button>
</div>
<div class="module-links">
<!-- Module links -->
<div class="module-links-container">
<div class="module-links">
<!-- Module links -->
</div>
</div>
</nav>
<main>
<form id="module-search-form">
<button class="menu-toggle">
<button class="menu-toggle" aria-label="Toggle sidebar">
<svg viewBox="0 0 72 72" id="emoji" xmlns="http://www.w3.org/2000/svg" fill="currentcolor">
<g id="SVGRepo_iconCarrier">
<g id="color"></g>

View file

@ -1,16 +1,15 @@
:root {
/* WCAG AAA Compliant colors */
--code-bg: #f4f8f9;
--gray: #717171;
--orange: #bf5000;
--green: #0b8400;
--cyan: #067c94;
/* WCAG AAA Compliant colors - important that luminence (the l in hsl) is 18% for font colors against the bg's luminence of 96-97% when the font-size is at least 14pt */
--code-bg: hsl(262 33% 96% / 1);
--gray: hsl(0 0% 18% / 1);
--orange: hsl(25 100% 18% / 1);
--green: hsl(115 100% 18% / 1);
--cyan: hsl(190 100% 18% / 1);
--blue: #05006d;
--violet: #7c38f5;
--violet-bg: #ece2fd;
--violet-bg: hsl(262.22deg 87.1% 93.92%);
--magenta: #a20031;
--link-hover-color: #333;
--link-color: var(--violet);
--code-link-color: var(--violet);
--text-color: #000;
@ -18,17 +17,17 @@
--body-bg-color: #ffffff;
--border-color: #717171;
--faded-color: #4c4c4c;
--font-sans: -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial,
sans-serif;
--font-mono: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier,
monospace;
--font-sans: -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
--font-mono: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
--top-header-height: 67px;
--sidebar-width: clamp(280px, 33dvw, 650px);
--sidebar-width: clamp(280px, 25dvw, 500px);
--module-search-height: 48px;
--module-search-padding-height: 12px;
--module-search-form-padding-width: 20px;
--sidebar-bg-color: hsl(from var(--violet-bg) h calc(s * 1.05) calc(l * 0.95));
}
a {
color: var(--violet);
}
@ -77,7 +76,7 @@ table tr td {
font-size: 16px;
font-weight: normal;
background-color: var(--violet-bg);
color: white;
color: var(--text-color);
width: auto;
margin-top: 0;
margin-bottom: 24px;
@ -86,7 +85,7 @@ table tr td {
}
.entry-name strong {
color: var(--violet);
color: var(--text-color);
}
.entry-name a {
@ -132,7 +131,7 @@ a:hover code {
display: flex;
align-items: center;
justify-content: flex-start;
gap: 16px;
gap: 8px;
background-color: var(--violet-bg);
padding-block: 16px;
position: sticky;
@ -184,7 +183,7 @@ main {
grid-column-end: content-end;
box-sizing: border-box;
position: relative;
font-size: 16px;
font-size: 14pt; /* This keeps links AAA compliant while still making the links distinctly colored. */
line-height: 1.85em;
margin-top: 2px;
padding: 16px;
@ -256,17 +255,29 @@ padding: 0px 16px;
grid-column-start: sidebar;
grid-column-end: main-content;
position: relative;
display: flex;
flex-direction: column;
display: grid;
grid-template-rows: min-content 1fr;
box-sizing: border-box;
width: 100%;
background-color: hsl(from var(--violet) h calc(s * 1.3) calc(l * .3));
overflow-y: auto;
scrollbar-color: var(--violet) var(--violet-bg);
scrollbar-gutter: stable both-edges;
background-color: var(--sidebar-bg-color);
transition: all 1s linear;
}
#sidebar-nav .module-links-container {
position: relative;
}
#sidebar-nav .module-links {
position: absolute;
inset: 0;
overflow-y: auto;
overflow-x: hidden;
scrollbar-color: var(--violet) var(--sidebar-bg-color);
scrollbar-gutter: stable both-edges;
padding-block: 1rem;
}
.top-header {
grid-column-start: sidebar;
grid-column-end: end;
@ -329,7 +340,7 @@ footer p {
}
.sidebar-sub-entries {
font-size: 14px;
font-size: 12pt;
}
.sidebar-sub-entries a {
@ -351,15 +362,25 @@ footer p {
}
.module-name {
font-size: 28px;
font-size: 40pt;
line-height: 1em;
font-family: var(--font-mono);
font-weight: bold;
margin-top: 48px;
margin-bottom: 48px;
margin-top: 36px;
margin-bottom: 16px;
color: var(--violet);
}
main h2 {
font-size: 28pt;
}
main h3 {
font-size: 24pt;
}
main h4 {
font-size: 20pt;
}
.module-name a,
.module-name a:visited {
color: inherit;
@ -371,7 +392,7 @@ color: inherit;
.sidebar-module-link {
box-sizing: border-box;
font-size: 16px;
font-size: 14pt;
line-height: 24px;
font-family: var(--font-mono);
display: block;
@ -430,6 +451,7 @@ a code {
color: var(--code-link-color);
background: none;
padding: 0;
font-weight: bold; /* Important for AAA compliance while keeping color distinct */
}
code a:visited,
@ -442,7 +464,6 @@ pre {
padding: 8px 16px;
box-sizing: border-box;
background-color: var(--code-bg);
overflow-x: hidden;
position: relative;
word-wrap: normal;
}
@ -472,9 +493,23 @@ pre>samp {
}
.menu-toggle {
display:none;
display: none;
margin-right: 8px;
appearance: none;
background-color: transparent;
outline: none;
border: none;
color: var(--violet);
padding: 0;
cursor: pointer;
}
.menu-toggle svg {
height: 48px;
width: 48px;
}
#module-search,
#module-search:focus {
opacity: 1;
@ -498,6 +533,12 @@ pre>samp {
border: 2px solid var(--violet-bg);
}
@media (prefers-color-scheme: light) {
#module-search {
outline: 1px solid var(--gray);
}
}
#module-search::placeholder {
color: var(--faded-color);
opacity: 1;
@ -598,7 +639,6 @@ pre>samp {
padding: 1px 3px 3px;
font-style: normal;
line-height: 15px;
opacity: 0.6;
pointer-events: none;
}
@ -626,26 +666,26 @@ pre>samp {
@media (prefers-color-scheme: dark) {
:root {
/* WCAG AAA Compliant colors */
--code-bg: #202746;
--gray: #b6b6b6;
--orange: #fd6e08;
--green: #8ecc88;
--cyan: #12c9be;
--blue: #b1afdf;
--violet: #CAADFB;
--violet-bg: #332944;
--magenta: #f39bac;
--code-bg: hsl(228.95deg 37.25% 20%);
--gray: hsl(0 0% 90% / 1);
--orange: hsl(25 98% 90% / 1);
--green: hsl(115 40% 90% / 1);
--cyan: hsl(176 84% 90% / 1);
--blue: hsl(243 43% 90% / 1);
--violet: #caadfb;
--violet-bg: #332944;
--magenta: hsl(348 79% 90% / 1);
--link-hover-color: #fff;
--link-color: var(--violet);
--code-link-color: var(--violet);
--text-color: #eaeaea;
--body-bg-color: #0e0e0f;
--body-bg-color: hsl(from var(--violet-bg) h s calc(l * .5));
--border-color: var(--gray);
--code-color: #eeeeee;
--logo-solid: #8f8f8f;
--faded-color: #bbbbbb;
--gray: #6e6e6e;
--sidebar-bg-color: hsl(from var(--violet-bg) h calc(s * 1.1) calc(l * 0.75));
}
html {