From eab480cd4b1aa336b3b1e3429f5d7a9be9f63903 Mon Sep 17 00:00:00 2001 From: Ricardo Casares <84963+ricardocasares@users.noreply.github.com> Date: Wed, 10 Feb 2021 19:28:05 +0100 Subject: [PATCH] fix: add aria-label attrs to buttons (#53) * fix: add aria-label to buttons * fix: add visually hidden descriptions for links --- src/components/Card/index.tsx | 3 ++- src/components/Header/index.tsx | 12 ++++++++---- src/components/Header/style.ts | 13 +++---------- src/components/Player/index.tsx | 6 +++--- src/css/utils.ts | 10 ++++++++++ 5 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/components/Card/index.tsx b/src/components/Card/index.tsx index 3961ee30..7d8809df 100644 --- a/src/components/Card/index.tsx +++ b/src/components/Card/index.tsx @@ -19,7 +19,7 @@ export const Card: FC = memo( ({ hash, title, subtitle, onPlay, onFaved, onUnFaved, isFaved }) => ( - @@ -29,6 +29,7 @@ export const Card: FC = memo( {subtitle || DEFAULT_SUBTITLE} )} {!playing && ( - )} - diff --git a/src/css/utils.ts b/src/css/utils.ts index 2e324ecc..860d024c 100644 --- a/src/css/utils.ts +++ b/src/css/utils.ts @@ -5,3 +5,13 @@ export const truncate = css` white-space: nowrap; text-overflow: ellipsis; `; + +export const hidden = css` + clip: rect(0 0 0 0); + clip-path: inset(50%); + height: 1px; + overflow: hidden; + position: absolute; + white-space: nowrap; + width: 1px; +`;