diff --git a/app/components/cart/cart.tsx b/app/components/cart/cart.tsx index 3679a719..c13454c5 100644 --- a/app/components/cart/cart.tsx +++ b/app/components/cart/cart.tsx @@ -1089,9 +1089,15 @@ function CartEmpty({ {t("cart.startShopping")} + {/* `medium` is page rhythm — `py-8 md:py-12 lg:py-16`, and those + breakpoints read the viewport, not this 400px drawer, so on a desktop + it took the 64px step. Stacked on the wrapper's own `space-y-12` that + put 112px of nothing between Start Shopping and the best sellers. The + drawer keeps the wrapper's 48px and nothing further; the cart page is + a page and still wants the page rhythm. */}
-
+
{t("account.modalTitle")} diff --git a/app/components/layout/container.ts b/app/components/layout/container.ts new file mode 100644 index 00000000..8d5b8f19 --- /dev/null +++ b/app/components/layout/container.ts @@ -0,0 +1,31 @@ +import { cva } from "class-variance-authority"; + +/** + * The gutters and maximum width the announcement bar, the nav and the footer + * all measure their content against. + * + * Each of the three carried its own copy and they had drifted apart. The + * footer stopped widening its gutter at `lg` where the nav carries on to + * `xl`, and the announcement bar sat on a gutter of its own at every size — + * so three rows stacked directly on top of one another started their content + * on three different columns. One definition keeps them on the same column + * whatever width the merchant has chosen. + * + * `padding` goes on the full-bleed element that paints the row's background, + * `width` on the content inside it, which is why they are separate variants + * rather than one class list. + */ +export const layoutWidth = cva("", { + variants: { + width: { + full: "h-full w-full", + stretch: "h-full w-full", + fixed: "mx-auto h-full w-full max-w-(--page-width)", + }, + padding: { + full: "", + stretch: "px-3 md:px-10 xl:px-16", + fixed: "mx-auto px-5 md:px-6 xl:px-10", + }, + }, +}); diff --git a/app/components/layout/country-selector.tsx b/app/components/layout/country-selector.tsx index 0d1e1814..9b2cd090 100644 --- a/app/components/layout/country-selector.tsx +++ b/app/components/layout/country-selector.tsx @@ -103,7 +103,7 @@ export function CountrySelector({ it flush against the edge. Aligning to the start lines its left edge up with the trigger, which is what the design shows. */} -
+
{localeOptions.map((locale) => { const isSelected = mode === "language" diff --git a/app/components/layout/dropdown-menu.tsx b/app/components/layout/dropdown-menu.tsx index 825491e6..973de3d4 100644 --- a/app/components/layout/dropdown-menu.tsx +++ b/app/components/layout/dropdown-menu.tsx @@ -28,7 +28,7 @@ export function DropdownMenu({ menuItem }: { menuItem: SingleMenuItem }) { e.preventDefault()} > {childItems.map( diff --git a/app/components/layout/footer.tsx b/app/components/layout/footer.tsx index c335d8bc..f6960979 100644 --- a/app/components/layout/footer.tsx +++ b/app/components/layout/footer.tsx @@ -1,6 +1,6 @@ +import { ArrowRightIcon } from "@phosphor-icons/react"; import * as Accordion from "@radix-ui/react-accordion"; import { useThemeSettings, useTranslation } from "@weaverse/hydrogen"; -import { cva } from "class-variance-authority"; import clsx from "clsx"; import { useFetcher, useRouteLoaderData } from "react-router"; import { CompanyLocationButton } from "~/components/b2b/company-location-button"; @@ -18,27 +18,14 @@ import { PaypalIcon, VisaIcon, } from "../icons"; -import Link from "../link"; +import Link, { variants } from "../link"; +import { layoutWidth } from "./container"; import { CountrySelector } from "./country-selector"; -const variants = cva("", { - variants: { - width: { - full: "", - stretch: "", - fixed: "mx-auto max-w-(--page-width)", - }, - padding: { - full: "", - stretch: "px-3 md:px-10 lg:px-16", - fixed: "mx-auto px-5 md:px-6 lg:px-6", - }, - }, -}); - -// Traced from the Figma newsletter assets. Like the divider star these are -// stroked paths (stroke-width 2 on an 18px viewBox), so Phosphor's filled -// outlines are not a match. +// Traced from the Figma newsletter asset. Like the divider star it is a +// stroked path (stroke-width 2 on an 18px viewBox), so Phosphor's filled +// outlines are not a match. The Send arrow beside it is the opposite case: +// the design draws Phosphor's filled ArrowRight, so that one is imported. function MailIcon() { return ( - - - ); -} - // Traced from the Figma divider asset. Not a Phosphor glyph: it is a stroked // path (stroke-width 2 on a 20px viewBox), while Phosphor draws filled outlines. function StarDividerIcon() { @@ -182,10 +149,10 @@ export function Footer() {