Skip to content

Commit 479053a

Browse files
fix: add accessible improvements (#2546)
1 parent 54a7ae7 commit 479053a

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

apps/web/src/components/button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ const getAppearance = (appearance: Appearance) => {
4343
return [
4444
'bg-white text-black',
4545
'hover:bg-white/90',
46-
'focus:ring-slate-8 focus:bg-white/90 focus:outline-none focus:ring-2',
46+
'focus-visible:ring-slate-10 focus-visible:bg-white/90 focus-visible:outline-none focus-visible:ring-2',
4747
'selection:text-black',
4848
];
4949
case 'gradient':
5050
return [
5151
'bg-gradient border-[#34343A] backdrop-blur-[1.25rem]',
5252
'hover:bg-gradientHover',
53-
'focus:bg-gradientHover focus:outline-none focus:ring-2 focus:ring-white/20',
53+
'focus-visible:bg-gradientHover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20',
5454
];
5555
default:
5656
unreachable(appearance);

apps/web/src/components/sections/integration.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const IntegrationSection = () => {
3838
mouseX.set(e.clientX - left);
3939
mouseY.set(e.clientY - top);
4040
}}
41-
className="group relative min-w-full max-w-full sm:min-w-[250px] sm:max-w-[250px] md:min-w-[280px] md:max-w-[280px] rounded-3xl bg-slate-4 p-px"
41+
className="group relative min-w-full max-w-full sm:min-w-[250px] sm:max-w-[250px] md:min-w-[280px] md:max-w-[280px] rounded-3xl bg-slate-4 p-px outline-none focus-visible:ring-slate-7 focus-visible:ring-1"
4242
href={item.href}
4343
>
4444
<motion.div

apps/web/src/components/sections/playground/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const PlaygroundSection = () => {
5454
<Tabs.Trigger
5555
key={tab.value}
5656
value={tab.value}
57-
className="group relative px-3 py-2 md:px-4"
57+
className="group relative px-3 py-2 md:px-4 rounded-xl outline-none"
5858
>
5959
<span
6060
className={classNames(
@@ -69,7 +69,7 @@ const PlaygroundSection = () => {
6969
<AnimatePresence mode="wait" initial={false}>
7070
{activeTab === tab.value && (
7171
<motion.div
72-
className="absolute inset-0 size-full rounded-xl bg-gradient-to-b from-zinc-800 to-zinc-950 border border-zinc-800 z-0"
72+
className="absolute inset-0 size-full rounded-xl bg-gradient-to-b from-zinc-800 to-zinc-950 border border-zinc-800 group-focus-visible:ring-slate-8 group-focus-visible:ring-2 z-0"
7373
layoutId="activeTab"
7474
transition={{
7575
type: 'spring',

apps/web/src/components/sections/tools/interactive-demo.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const InteractiveDemo = () => {
4848
<button
4949
type="button"
5050
key={tool.title}
51-
className="relative px-4 py-3 md:p-6 max-w-md cursor-pointer text-start outline-none group"
51+
className="group relative px-4 py-3 md:p-6 max-w-md cursor-pointer text-start outline-none rounded-[20px] focus-visible:ring-slate-8 focus-visible:ring-1"
5252
onClick={() => {
5353
setActiveTool(tool.value);
5454
}}
@@ -58,7 +58,11 @@ export const InteractiveDemo = () => {
5858
{tool.value === activeTool && (
5959
<motion.div
6060
layoutId="background"
61-
className="absolute inset-0 -z-10 bg-[#17171799] rounded-[20px] shadow-[0px_32px_64px_-16px_transparent,0px_16px_32px_-8px_transparent,0px_8px_16px_-4px_transparent,0px_4px_8px_-2px_transparent,0px_-8px_16px_-1px_transparent,0px_2px_4px_-1px_transparent,0px_0px_0px_1px_transparent,inset_0px_0px_0px_1px_#ffffff1a,inset_0px_1px_0px_#ffffff26]"
61+
className={classNames(
62+
'absolute inset-0 -z-10 bg-[#17171799] rounded-[20px]',
63+
'shadow-[0px_32px_64px_-16px_transparent,0px_16px_32px_-8px_transparent,0px_8px_16px_-4px_transparent,0px_4px_8px_-2px_transparent,0px_-8px_16px_-1px_transparent,0px_2px_4px_-1px_transparent,0px_0px_0px_1px_transparent,inset_0px_0px_0px_1px_#ffffff1a,inset_0px_1px_0px_#ffffff26]',
64+
)}
65+
onFocus={() => setActiveTool(tool.value)}
6266
initial={{ opacity: 0 }}
6367
animate={{ opacity: 1 }}
6468
exit={{ opacity: 0 }}
@@ -134,7 +138,7 @@ export const InteractiveDemo = () => {
134138
key={tool.title}
135139
value={tool.value}
136140
className={classNames(
137-
'relative capitalize px-1 text-sm font-normal transition-colors',
141+
'relative capitalize px-1 text-sm font-normal transition-colors outline-none focus-visible:ring-2 focus-visible:ring-slate-7',
138142
tool.value === activeTool
139143
? 'text-cyan-11'
140144
: 'text-slate-10 hover:text-slate-12',
@@ -161,7 +165,7 @@ export const InteractiveDemo = () => {
161165
<Tabs.Content
162166
key={tool.title}
163167
value={tool.value}
164-
className="relative z-10 bg-black pl-4 pr-9 pt-3 h-32 max-md:overflow-x-auto"
168+
className="relative z-10 bg-black pl-4 pr-9 pt-3 h-32 max-md:overflow-x-auto outline-none"
165169
>
166170
{tool.value === 'spam' ? (
167171
<div className="flex flex-col items-center justify-center pt-6">

apps/web/src/components/topbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function Topbar({
1717
{...props}
1818
>
1919
<Link
20-
className="-ml-[.375rem] flex scroll-m-2 rounded-md pr-[.375rem] transition-colors focus:outline-none focus:ring focus:ring-slate-4"
20+
className="-ml-[.375rem] flex scroll-m-2 rounded-md pr-[.375rem] transition-colors focus:outline-none focus-visible:ring focus-visible:ring-slate-4"
2121
href="/"
2222
>
2323
<Logo />

0 commit comments

Comments
 (0)