www: improve accessbility (#1507)

This commit is contained in:
Tim Hårek Andreassen
2023-07-22 20:23:42 +02:00
committed by GitHub
parent 16453b4dc9
commit 9cae8fdd5c
13 changed files with 61 additions and 30 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ export default function DocsSidebar(
}
const link = "text(gray-900 hover:gray-600)";
const linkActive = "text(green-600 hover:green-500) font-bold";
const linkActive = "text-green-700 hover:underline font-bold";
export function SidebarCategory(props: {
path: string;
+1 -1
View File
@@ -10,9 +10,9 @@ export default function DocsTitle(props: { title: string }) {
preserveAspectRatio="xMinYMin"
viewBox="0 0 250 75"
fill="none"
alt="Fresh logo"
xmlns="http://www.w3.org/2000/svg"
class="h-5 inline-block"
aria-label="Fresh logo"
>
<path
d="M14.0805 0.761269V70.0893H0V0.761269H14.0805ZM35.6322 30.2257V41.7803H10.3448V30.2257H35.6322ZM38.5057 0.761269V12.3159H10.3448V0.761269H38.5057ZM46.5517 0.761269H68.9655C73.5632 0.761269 77.5862 1.62785 80.7471 3.36105C83.908 4.80538 86.4943 7.11632 88.2184 10.2939C90.1641 13.8269 91.1548 17.8107 91.092 21.8485C91.092 25.6038 90.5172 28.7813 89.3678 31.3811C88.5057 34.2698 87.069 36.2919 85.0575 38.0251C83.046 39.7583 81.0345 40.9137 78.4483 42.3581L74.1379 44.669H56.0345V33.1143H68.3908C70.0971 33.2247 71.7975 32.8225 73.2759 31.9589C74.4253 31.0923 75.2874 29.9368 76.1494 28.4925C76.8253 26.6458 77.1186 24.6798 77.0115 22.7151C77.0115 20.6931 76.7241 18.9599 76.1494 17.2267C75.5747 15.7823 74.7126 14.338 73.2759 13.7603C72.4138 12.8937 70.6897 12.3159 68.9655 12.3159H60.3448V70.0893H46.5517V0.761269V0.761269ZM78.1609 70.0893L65.5172 39.1805H79.8851L93.1035 69.5115V70.0893H78.1609ZM140.517 58.5346V70.0893H110.345V58.5346H140.517ZM114.655 0.761269V70.0893H100.575V0.761269H114.943H114.655ZM136.494 29.0702V40.0471H110.345V29.0702H136.207H136.494ZM140.517 0.761269V12.3159H110.345V0.761269H140.517ZM178.161 51.8907C178.161 50.7352 178.161 49.5797 177.586 48.7131C177.586 47.5577 177.012 46.6911 176.149 45.8245L173.276 42.9358L167.816 40.6249L160.345 37.1585L154.023 32.8255C152.021 31.2537 150.359 29.2878 149.138 27.0481C148.066 24.5949 147.574 21.9252 147.701 19.2487C147.701 16.3601 147.989 13.4714 149.138 11.4493C150.166 9.00506 151.739 6.83084 153.736 5.09427C155.747 3.64994 158.046 2.20559 160.632 1.33899C167.362 -0.855543 174.677 -0.337717 181.034 2.78333C184.483 4.51653 186.782 7.11632 188.793 10.2939C190.517 13.1825 191.667 17.2267 191.667 21.2708H177.299C177.424 19.5169 177.229 17.7548 176.724 16.0712C176.149 14.6269 175.287 13.1825 173.851 12.6048C172.701 11.7382 170.977 11.1605 169.253 11.1605C167.529 11.1605 166.092 11.7382 164.943 12.3159C163.793 12.8937 162.931 14.0491 162.069 15.2046L161.494 19.2487C161.494 20.4042 161.782 21.5597 162.356 22.4263L164.655 24.7372C167.235 26.2818 169.924 27.6335 172.701 28.7813L181.034 32.8255C183.199 34.2594 185.136 36.0121 186.782 38.0251C188.793 39.7583 189.655 41.7803 190.805 43.8024C192.605 48.9619 192.503 54.5998 190.517 59.6901C189.368 62.001 187.931 64.0231 186.207 65.7563C184.115 67.5878 181.669 68.9647 179.023 69.8004C173.276 71.2447 176.149 75 170.402 75C164.655 75 166.667 70.667 161.207 69.8004C158.333 68.9338 155.46 67.4895 153.448 65.7563C151.19 63.7856 149.419 61.313 148.276 58.5346C147.126 55.6459 146.552 52.1795 146.552 48.4243H160.632C160.632 50.4463 160.632 52.1795 161.207 53.6239C161.494 55.0682 162.069 56.5125 162.931 57.3791C163.793 57.9569 164.943 58.8235 166.092 59.1123C167.529 59.6901 168.966 59.6901 170.402 59.6901C172.414 59.6901 173.851 59.6901 175 58.8235C176.149 57.9569 176.724 57.0903 177.299 55.9348C177.874 54.7793 178.161 53.335 178.161 51.8907V51.8907ZM239.943 28.7813V40.336H211.207V28.7813H239.943ZM215.23 0.761269V70.0893H201.437V0.761269H215.23ZM250 0.761269V70.0893H236.207V0.761269H250Z"
+6
View File
@@ -5,6 +5,7 @@ export function NoBuild() {
viewBox="0 0 75 75"
fill="none"
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
>
<path
d="M29.6442 31.5258C32.7992 30.1446 35 27.0249 35 23.3976C35 19.5107 31.9774 16.2066 28.4569 15L28.4771 23.0715L26.1651 24.4575L23.6055 23.0715L22.5523 15C19.0318 16.2066 17 19.5107 17 23.3976C17 27.0249 19.2008 30.1446 22.3558 31.5258L20.9876 59.8211C20.8443 62.6385 23.1298 65 26 65C28.8702 65 31.1557 62.6385 31.0124 59.8211L29.6442 31.5258Z"
@@ -34,6 +35,7 @@ export function TypeScript() {
viewBox="0 0 75 75"
fill="none"
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
>
<rect
x="19.0002"
@@ -103,6 +105,7 @@ export function Island() {
viewBox="0 0 75 75"
fill="none"
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
>
<path
d="M24.8765 39.3727C16.4753 36.5509 8.60772 50.9392 13.5157 54.999C18.4236 59.0588 27.0005 56.7329 35.569 56.7329C38.2618 56.7329 41.2797 56.7952 44.2466 56.8159C49.2995 57.4544 59.6147 57.6582 60.4526 53.3657C62.4427 47.3005 51.5966 33.7385 47.8048 32.5681C36.246 29.0003 37.3759 43.5709 24.8765 39.3727Z"
@@ -145,6 +148,7 @@ export function Globe() {
viewBox="0 0 75 75"
fill="none"
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
>
<circle cx="37.5" cy="37.5" r="20.5" fill="white" />
<path
@@ -165,6 +169,7 @@ export function LightWeight() {
viewBox="0 0 75 75"
fill="none"
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
>
<path
d="M30.323 50.1677C29.8721 49.8671 28.7299 48.6949 27.7681 46.4105C36.7993 41.3595 29.128 29.5594 21.1555 35.8905C15.5533 40.3393 17.6603 50.2484 19.7385 56.4481C17.4611 57.4948 14.4355 63.0071 16.9474 65.5191C19.4594 68.031 23.3436 65.8806 24.9717 64.4913C27.4228 65.3605 30.8953 65.8286 34.3916 66.2169C33.3449 73.1945 43.4625 72.8456 45.207 70.4035C46.9514 67.9613 45.9047 68.3102 45.9047 66.2169C47.5891 65.8119 48.1797 65.4739 49.5 64.4913C52.0585 64.9679 59.5112 67.6124 63 59.5881C57.069 60.9836 53.7647 58.8955 51 57.5C48 44.5 34.3916 44 30.323 50.1677Z"
@@ -208,6 +213,7 @@ export function Gabage() {
viewBox="0 0 75 75"
fill="none"
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
>
<path
d="M16.005 26.4841C15.4819 23.4303 56.4538 22.9234 57 26.4841L56.0103 35.8989L48.0082 42.1286C48.0082 47.559 26.9502 47.2714 26.9502 41.298L16.8423 35.0682L16.005 26.4841Z"
+5
View File
@@ -62,6 +62,7 @@ export function Copy() {
viewBox="0 0 15 15"
fill="none"
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
>
<path
d="M1.55566 2.7C1.55566 2.03726 2.09292 1.5 2.75566 1.5H8.75566C9.41841 1.5 9.95566 2.03726 9.95566 2.7V5.1H12.3557C13.0184 5.1 13.5557 5.63726 13.5557 6.3V12.3C13.5557 12.9627 13.0184 13.5 12.3557 13.5H6.35566C5.69292 13.5 5.15566 12.9627 5.15566 12.3V9.9H2.75566C2.09292 9.9 1.55566 9.36274 1.55566 8.7V2.7ZM6.35566 9.9V12.3H12.3557V6.3H9.95566V8.7C9.95566 9.36274 9.41841 9.9 8.75566 9.9H6.35566ZM8.75566 8.7V2.7L2.75566 2.7V8.7H8.75566Z"
@@ -80,6 +81,7 @@ export function Check() {
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
aria-hidden="true"
>
<path
stroke-width={3}
@@ -117,6 +119,7 @@ export function GitHub(props: { class?: string }) {
class={`h-6 w-6 ${props.class ?? ""}`}
fill="currentColor"
viewBox="0 0 24 24"
aria-hidden="true"
>
<path
fillRule="evenodd"
@@ -133,6 +136,7 @@ export function Discord(props: { class?: string }) {
class={`h-6 w-6 ${props.class ?? ""}`}
fill="currentColor"
viewBox="0 0 24 24"
aria-hidden="true"
>
<path
fill="currentColor"
@@ -152,6 +156,7 @@ export function ArrowRight() {
viewBox="0 0 20 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
>
<path
d="M13.0833 14.4167L16.9166 10.5834C16.9999 10.5 17.0588 10.4098 17.0933 10.3125C17.1283 10.2153 17.1458 10.1112 17.1458 10C17.1458 9.88893 17.1283 9.78476 17.0933 9.68754C17.0588 9.59032 16.9999 9.50004 16.9166 9.41671L13.0624 5.56254C12.9096 5.40976 12.7221 5.33337 12.4999 5.33337C12.2777 5.33337 12.0833 5.41671 11.9166 5.58337C11.7638 5.73615 11.6874 5.9306 11.6874 6.16671C11.6874 6.40282 11.7638 6.59726 11.9166 6.75004L14.3333 9.16671H3.33325C3.09714 9.16671 2.89936 9.24643 2.73992 9.40587C2.57992 9.56587 2.49992 9.76393 2.49992 10C2.49992 10.2362 2.57992 10.4339 2.73992 10.5934C2.89936 10.7534 3.09714 10.8334 3.33325 10.8334H14.3333L11.8958 13.2709C11.743 13.4237 11.6666 13.6112 11.6666 13.8334C11.6666 14.0556 11.7499 14.25 11.9166 14.4167C12.0694 14.5695 12.2638 14.6459 12.4999 14.6459C12.736 14.6459 12.9305 14.5695 13.0833 14.4167Z"
+17 -10
View File
@@ -142,20 +142,21 @@ const Carousel = (props: CarouselProps) => {
};
const DotsNavigation = () => (
<div
class={"slide_nav z-30 w-full absolute bottom-0 flex justify-center cursor-pointer"}
>
<div class={"slide_nav z-30 w-full absolute bottom-0 flex justify-center"}>
{SLIDE_DATA.map((_item, idx) => {
return (
<div
<button
class={`px-1 ${NAVIGATION_COLOR}`}
onClick={() => {
goToSlide(idx);
}}
key={idx}
>
{idx === currentSlide.value ? <>●</> : <>○</>}
</div>
<span class="sr-only">Go to slide {idx}</span>
{idx === currentSlide.value
? <span class="not-sr-only">●</span>
: <span class="not-sr-only">○</span>}
</button>
);
})}
</div>
@@ -169,16 +170,22 @@ const Carousel = (props: CarouselProps) => {
}`}
tabIndex={0}
>
<IconCircleChevronsLeft
<button
class={`left-0 ${CHEVRON_STYLE}`}
style="top: calc(50% - 20px)"
onClick={() => chevronClick(previousSlide)}
/>
<IconCircleChevronsRight
>
<IconCircleChevronsLeft class="w-10 h-10" aria-hidden="true" />
<span class="sr-only">Previous slide</span>
</button>
<button
class={`right-0 ${CHEVRON_STYLE}`}
style="top: calc(50% - 20px)"
onClick={() => chevronClick(nextSlide)}
/>
>
<IconCircleChevronsRight class="w-10 h-10" aria-hidden="true" />
<span class="sr-only">Next slide</span>
</button>
{SLIDE_DATA.map((item, idx) => (
<Slide
data={item}
+6 -3
View File
@@ -29,7 +29,7 @@ export default function Features() {
return (
<div class="flex-1 space-y-2">
<div class="bg-blue-600 inline-block p-3 rounded-xl text-white">
<item.icon class="w-10 h-10" />
<item.icon class="w-10 h-10" aria-hidden="true" />
</div>
<p class="text-xl">
{item.description}
@@ -38,9 +38,12 @@ export default function Features() {
{item.link &&
(
<a class="block" href={item.link}>
<p class="text-blue-500 cursor-pointer hover:underline inline-flex items-center group">
<p class="text-blue-600 cursor-pointer hover:underline inline-flex items-center group">
Read More{" "}
<IconChevronRight class="inline-block w-5 h-5 transition group-hover:translate-x-0.5" />
<IconChevronRight
class="inline-block w-5 h-5 transition group-hover:translate-x-0.5"
aria-hidden="true"
/>
</p>
</a>
)}
+2 -2
View File
@@ -30,7 +30,7 @@ export default function Footer({ children }: Props) {
<div class="bg-white flex flex-col md:flex-row w-full max-w-screen-lg gap-8 md:gap-16 px-8 py-8 text-sm">
<div class="flex-1">
<div class="flex items-center gap-1">
<LemonIcon class="inline-block" />
<LemonIcon class="inline-block" aria-hidden="true" />
<div class="font-bold text-2xl">
Fresh
</div>
@@ -69,7 +69,7 @@ export default function Footer({ children }: Props) {
class="inline-block hover:text-black"
aria-label="GitHub"
>
<BrandGithub />
<BrandGithub aria-hidden="true" />
</a>
</div>
</div>
+1 -1
View File
@@ -14,7 +14,7 @@ export default function Header({ active }: Props) {
return (
<div class="bg-white w-full max-w-screen-lg py-6 px-8 flex flex-col md:flex-row gap-4">
<div class="flex items-center flex-1">
<LemonIcon />
<LemonIcon aria-hidden="true" />
<div class="text-2xl ml-1 font-bold">
Fresh
</div>
+5 -2
View File
@@ -17,7 +17,7 @@ export default function Hero() {
<div class="flex flex-col md:flex-row items-center">
<a
href="#"
class="block mt-4 text-blue-500 cursor-pointer inline-flex items-center group text-blue-800 bg-white px-8 py-2 rounded-md hover:bg-blue-50 font-bold"
class="block mt-4 text-blue-600 cursor-pointer inline-flex items-center group text-blue-800 bg-white px-8 py-2 rounded-md hover:bg-blue-50 font-bold"
>
Sign Up{" "}
</a>
@@ -26,7 +26,10 @@ export default function Hero() {
class="block mt-4 transition-colors text-blue-400 cursor-pointer inline-flex items-center group px-4 py-2 hover:text-blue-100"
>
Documentation{" "}
<IconChevronRight class="inline-block w-5 h-5 transition group-hover:translate-x-0.5" />
<IconChevronRight
class="inline-block w-5 h-5 transition group-hover:translate-x-0.5"
aria-hidden="true"
/>
</a>
</div>
</div>
+8 -2
View File
@@ -57,7 +57,10 @@ export default function ComponentGallery(props: ComponentGalleryProps) {
Click me
</Button>
<Button class="flex gap-1">
<IconHappy class="w-6 h-6 inline-block text-gray-500" />
<IconHappy
class="w-6 h-6 inline-block text-gray-500"
aria-hidden="true"
/>
<div>
With an Icon
</div>
@@ -81,7 +84,10 @@ export default function ComponentGallery(props: ComponentGalleryProps) {
source={props.sources.LinkButton}
>
<LinkButton>
<IconHeart class="w-5 h-5 mr-1 inline-block text-gray-400" />
<IconHeart
class="w-5 h-5 mr-1 inline-block text-gray-400"
aria-hidden="true"
/>
Like me
</LinkButton>
</Section>
+2 -2
View File
@@ -38,8 +38,8 @@ export default function CopyArea(props: { code: string }) {
<div class="relative my-2 mr-4">
<div
class={`transition ease-in-out absolute pointer-events-none bg-gray-900 text-white absolute p-2 -top-1/3 left-1/2 transform -translate-x-1/2 -translate-y-full box-border rounded opacity-0 ${
copied.value && "opacity-100"
class={`hidden transition ease-in-out absolute pointer-events-none bg-gray-900 text-white absolute p-2 -top-1/3 left-1/2 transform -translate-x-1/2 -translate-y-full box-border rounded opacity-0 ${
copied.value && "block opacity-100"
}`}
>
Copied!
+1 -1
View File
@@ -20,7 +20,7 @@ export default function VersionSelect(
</label>
{selectedIsLatest && (
<div class="flex absolute pointer-events-none select-none w-full h-full items-center justify-end pr-8">
<div class="rounded-full px-2 py-1 text-xs tag-label bg-[#056CF025] text-blue-600">
<div class="rounded-full px-2 py-1 text-xs tag-label bg-[#056CF025] text-blue-700">
Latest
</div>
</div>
+6 -5
View File
@@ -89,11 +89,12 @@ function HelloBar() {
function Hero() {
return (
<>
<section class="w-full flex justify-center items-center flex-col bg-green-300">
<LemonDrop />
</section>
</>
<div
class="w-full flex justify-center items-center flex-col bg-green-300"
aria-hidden="true"
>
<LemonDrop />
</div>
);
}