diff --git a/src/components/organisms/BuildTools/BuildTools.module.scss b/src/components/organisms/BuildTools/BuildTools.module.scss index b0e4cef..2c529ab 100644 --- a/src/components/organisms/BuildTools/BuildTools.module.scss +++ b/src/components/organisms/BuildTools/BuildTools.module.scss @@ -40,15 +40,34 @@ .box { display: flex; flex-direction: column; - cursor: pointer; + + // The button is positioned against the box. + position: relative; width: rem(308); height: rem(300); - padding: rem(20) rem(10) rem(10); color: var(--color-bg); background-color: var(--color-stone); border-radius: rem(4); } +// Fills the box; the bottom padding keeps the text clear of the button. +.boxLink { + display: flex; + flex: 1; + flex-direction: column; + padding: rem(20) rem(10) rem(48); + color: inherit; + text-decoration: none; + border-radius: inherit; + + // The link is each box's only tab stop, and the global reset drops the + // focus outline. + &:focus-visible { + outline: 2px solid var(--color-step-text); + outline-offset: 2px; + } +} + .boxTitle { @include font-size(26px, 0.95); @@ -67,8 +86,9 @@ } .boxButton { - align-self: flex-end; - margin-top: auto; + position: absolute; + right: rem(10); + bottom: rem(10); } .headingBlock { diff --git a/src/components/organisms/BuildTools/BuildTools.tsx b/src/components/organisms/BuildTools/BuildTools.tsx index 2d3858c..ef6eef1 100644 --- a/src/components/organisms/BuildTools/BuildTools.tsx +++ b/src/components/organisms/BuildTools/BuildTools.tsx @@ -1,6 +1,6 @@ 'use client'; -import { useRouter } from 'next/navigation'; +import Link from 'next/link'; import styles from './BuildTools.module.scss'; @@ -35,24 +35,32 @@ const boxes = [ }, ]; -const renderBox = (index: number, go: (href: string) => void) => { +const renderBox = (index: number) => { const { title, text, href } = boxes[index]!; return ( + // The zone is the box: hovering anywhere on it flies the button's arrow + // (see the Button atom), and the link fills it.
-

- {title} -

-

- {text} -

+ +

+ {title} +

+

+ {text} +

+ + {/* Beside the link, since an anchor cannot hold another one. The box + is the link, so this copy stays out of the tab order and the + accessibility tree. */}
); @@ -60,8 +68,6 @@ const renderBox = (index: number, go: (href: string) => void) => { const BuildTools = () => { const sectionRef = useReveal(); - const router = useRouter(); - const go = (href: string) => router.push(href); return (
{ >
- {renderBox(0, go)} - {renderBox(1, go)} + {renderBox(0)} + {renderBox(1)}
- {renderBox(2, go)} - {renderBox(3, go)} + {renderBox(2)} + {renderBox(3)}