Something went wrong. Try again.
A daily game
Something went wrong. Try again.
797 B · 31 lines
TSX
at main
1234567891011121314151617181920212223242526272829303132import { cva } from "class-variance-authority";import { PropsWithChildren } from "react";
const caption = cva("flex justify-center text-2xl", { variants: { orientation: { vertical: "grid-rows-subgrid row-start-3 -row-end-3 flex-col", horizontal: "grid-cols-subgrid col-start-3 -col-end-3", }, position: { left: "col-start-1", top: "row-start-1", right: "-col-start-1", bottom: "-row-start-1", }, },});
interface Props { position: "left" | "top" | "right" | "bottom";}
export function VariantCaption({ position, children,}: PropsWithChildren<Props>) { const orientation = ["top", "bottom"].includes(position) ? "horizontal" : "vertical"; return <div className={caption({ position, orientation })}>{children}</div>;}