diff --git a/app/Catalog/ProductMediaDefinitions.php b/app/Catalog/ProductMediaDefinitions.php new file mode 100644 index 0000000..6f7e0b3 --- /dev/null +++ b/app/Catalog/ProductMediaDefinitions.php @@ -0,0 +1,43 @@ + width in px. Named `w{width}` so the srcset can be built from the name. */ + public const WIDTHS = [ + 'w160' => 160, + 'w400' => 400, + 'w800' => 800, + 'w1200' => 1200, + 'w1600' => 1600, + ]; + + protected function registerCollectionConversions(MediaCollection $collection, HasMedia $model): void + { + $collection->registerMediaConversions(function (Media $media) use ($model) { + foreach (self::WIDTHS as $name => $width) { + $model->addMediaConversion($name) + ->width($width, [Constraint::PreserveAspectRatio, Constraint::DoNotUpsize]) + ->format('webp') + ->quality(80); + } + }); + } +} diff --git a/config/lunar/media.php b/config/lunar/media.php index 05039f1..1e5a8aa 100644 --- a/config/lunar/media.php +++ b/config/lunar/media.php @@ -1,5 +1,6 @@ StandardMediaDefinitions::class, 'brand' => StandardMediaDefinitions::class, 'collection' => StandardMediaDefinitions::class, - 'product' => StandardMediaDefinitions::class, + 'product' => ProductMediaDefinitions::class, 'product-option' => StandardMediaDefinitions::class, 'product-option-value' => StandardMediaDefinitions::class, ], diff --git a/resources/css/app.css b/resources/css/app.css index 9592cb9..c87e3b6 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -34,6 +34,17 @@ @theme { BASE ═══════════════════════════════════════════════════════════════════ */ @layer base { + /* Heading scale steps down below `lg`, so a heading keeps one class + (text-h2) at every size instead of stepping text-h3 sm:text-h2. */ + @media (width < 64rem) { + :root { + --text-h1: 48px; + --text-h2: 40px; + --text-h3: 30px; + --text-h4: 22px; + } + } + body { background-color: theme(colors.neutral.200); font-family: var(--font-sans); diff --git a/resources/views/account/email-code.blade.php b/resources/views/account/email-code.blade.php index 1e4ff5d..a1a01ca 100644 --- a/resources/views/account/email-code.blade.php +++ b/resources/views/account/email-code.blade.php @@ -7,7 +7,7 @@
-

+

{{ __('storefront.auth.enter_code') }}

diff --git a/resources/views/account/email.blade.php b/resources/views/account/email.blade.php index 05326b3..c9f215f 100644 --- a/resources/views/account/email.blade.php +++ b/resources/views/account/email.blade.php @@ -7,7 +7,7 @@
-

+

{{ __('storefront.account.email_change_heading') }}

diff --git a/resources/views/account/orders/index.blade.php b/resources/views/account/orders/index.blade.php index fb1bebe..45e0e77 100644 --- a/resources/views/account/orders/index.blade.php +++ b/resources/views/account/orders/index.blade.php @@ -6,7 +6,7 @@
-

+

{{ __('storefront.account.nav_orders') }}

diff --git a/resources/views/account/orders/show.blade.php b/resources/views/account/orders/show.blade.php index 853c97c..8da240b 100644 --- a/resources/views/account/orders/show.blade.php +++ b/resources/views/account/orders/show.blade.php @@ -21,7 +21,7 @@ {{ __('storefront.orders.back') }} -

+

{{ __('storefront.orders.order_title', ['number' => $orderReference]) }}

diff --git a/resources/views/account/show.blade.php b/resources/views/account/show.blade.php index abe75a0..52dc738 100644 --- a/resources/views/account/show.blade.php +++ b/resources/views/account/show.blade.php @@ -17,7 +17,7 @@
-

+

{{ __('storefront.account.nav_profile') }}

diff --git a/resources/views/account/wishlist.blade.php b/resources/views/account/wishlist.blade.php index 32ea261..fcbb1e1 100644 --- a/resources/views/account/wishlist.blade.php +++ b/resources/views/account/wishlist.blade.php @@ -6,7 +6,7 @@
-

+

{{ __('storefront.account.nav_wishlist') }}

diff --git a/resources/views/auth/login-code.blade.php b/resources/views/auth/login-code.blade.php index fa57212..36fe110 100644 --- a/resources/views/auth/login-code.blade.php +++ b/resources/views/auth/login-code.blade.php @@ -8,9 +8,9 @@ @section('content') -
+
-

+

{{ __('storefront.auth.enter_code') }}

diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index da4a8f8..2c23966 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -13,9 +13,9 @@ @section('content') -
+
-

+

{{ __('storefront.auth.login') }}

diff --git a/resources/views/category/show.blade.php b/resources/views/category/show.blade.php index 7f6ed73..b78f104 100644 --- a/resources/views/category/show.blade.php +++ b/resources/views/category/show.blade.php @@ -15,10 +15,10 @@ @section('content') {{--
--}} -
+
-

{{ $collection['name'] }}

+

{{ $collection['name'] }}

-
+
{{-- Logo --}} diff --git a/resources/views/components/header.blade.php b/resources/views/components/header.blade.php index c0a88a0..29191cc 100644 --- a/resources/views/components/header.blade.php +++ b/resources/views/components/header.blade.php @@ -1,5 +1,6 @@ -
-
+{{-- No bottom border on the mobile homepage, so the header runs straight into the hero. --}} +
request()->routeIs('home')])> +
{{-- Logo --}} @@ -119,9 +120,9 @@ class="burger flex h-10 w-10.5 shrink-0 flex-col items-center justify-center gap id="mobile-nav" popover aria-label="{{ __('storefront.nav.menu') }}" - class="mobile-menu fixed inset-x-0 top-20 bottom-auto m-0 max-h-[calc(100dvh-5rem)] w-full max-w-none overflow-y-auto border-0 border-b border-black bg-neutral-200 p-0 text-black" + class="mobile-menu fixed inset-x-0 top-20 bottom-auto m-0 max-h-[calc(100dvh-5rem)] w-full max-w-none overflow-y-auto border-0 bg-neutral-200 p-0 text-black" > -
+