From 1381783490968164a925e1663874b585bfeb5a9b Mon Sep 17 00:00:00 2001 From: Michael Novotny Date: Sat, 15 Jul 2023 00:30:22 -0500 Subject: [PATCH] Adds focus styles --- app/globals.css | 6 ++++ app/product/[handle]/page.tsx | 2 +- components/carousel.tsx | 44 +++++++++++------------- components/cart/modal.tsx | 8 ++--- components/grid/index.tsx | 9 ++--- components/grid/tile.tsx | 9 +++-- components/layout/product-grid-items.tsx | 2 +- components/product/gallery.tsx | 2 +- 8 files changed, 40 insertions(+), 42 deletions(-) diff --git a/app/globals.css b/app/globals.css index c0eca5423..a941157bd 100644 --- a/app/globals.css +++ b/app/globals.css @@ -7,3 +7,9 @@ clip-path: inset(0.6px); } } + +a, +input, +button { + @apply focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2 focus:ring-offset-gray-50 dark:focus:ring-gray-600 dark:focus:ring-offset-dark; +} diff --git a/app/product/[handle]/page.tsx b/app/product/[handle]/page.tsx index 4fc443f9a..d9c7b9e40 100644 --- a/app/product/[handle]/page.tsx +++ b/app/product/[handle]/page.tsx @@ -115,7 +115,7 @@ async function RelatedProducts({ id }: { id: string }) { return (
Related Products
-
+
{relatedProducts.map((product, i) => { return ( -
- {[...products, ...products].map((product, i) => ( - - - - ))} -
+
+ {[...products, ...products].map((product, i) => ( + + + + ))}
); } diff --git a/components/cart/modal.tsx b/components/cart/modal.tsx index 25e3ccfd0..c2ed2d1ae 100644 --- a/components/cart/modal.tsx +++ b/components/cart/modal.tsx @@ -79,7 +79,7 @@ export default function CartModal({ cart }: { cart: Cart | undefined }) {

Your cart is empty.

) : ( -
+
    {cart.lines.map((item, i) => { const merchandiseSearchParams = {} as MerchandiseSearchParams; @@ -101,7 +101,7 @@ export default function CartModal({ cart }: { cart: Cart | undefined }) { data-testid="cart-item" className="flex w-full flex-col border-b border-gray-300 dark:border-gray-700" > -
    +
    @@ -180,9 +180,9 @@ export default function CartModal({ cart }: { cart: Cart | undefined }) {
    - Proceed to Checkout + Proceed to Checkout
    )} diff --git a/components/grid/index.tsx b/components/grid/index.tsx index 346a7833b..2af9a9767 100644 --- a/components/grid/index.tsx +++ b/components/grid/index.tsx @@ -10,17 +10,12 @@ function Grid(props: React.ComponentProps<'ul'>) { function GridItem(props: React.ComponentProps<'li'>) { return ( -
  • +
  • {props.children}
  • ); } Grid.Item = GridItem; + export default Grid; diff --git a/components/grid/tile.tsx b/components/grid/tile.tsx index c039a6727..87ec8f3f1 100644 --- a/components/grid/tile.tsx +++ b/components/grid/tile.tsx @@ -22,12 +22,11 @@ export function GridTileImage({ return (
    diff --git a/components/layout/product-grid-items.tsx b/components/layout/product-grid-items.tsx index 0c0e907ed..364d4e5df 100644 --- a/components/layout/product-grid-items.tsx +++ b/components/layout/product-grid-items.tsx @@ -8,7 +8,7 @@ export default function ProductGridItems({ products }: { products: Product[] }) <> {products.map((product) => ( - + {images.length > 1 ? ( -
    +
    {images.map((image, index) => { const isActive = index === currentImage; return (