Let hero stats cards auto-expand to fit long values.
Deploy Ladill Frontdesk / deploy (push) Successful in 37s

Replace fixed mobile widths and equal grid columns with content-sized cards so figures like GHS balances and storage sizes are never clipped.
This commit is contained in:
isaacclad
2026-07-24 14:53:10 +00:00
parent 689b8ff056
commit a794a27294
2 changed files with 10 additions and 4 deletions
+8 -2
View File
@@ -101,7 +101,10 @@ html.qr-mobile-page body {
} }
.mobile-stats-card { .mobile-stats-card {
width: calc(66.666667% - 0.5rem); width: max-content;
min-width: 9rem;
max-width: none;
box-sizing: border-box;
} }
@layer components { @layer components {
@@ -313,7 +316,10 @@ html.qr-mobile-page body {
@media (min-width: 640px) { @media (min-width: 640px) {
.mobile-stats-card { .mobile-stats-card {
width: auto; width: max-content;
min-width: 9rem;
max-width: none;
flex: 1 1 auto;
} }
} }
@@ -25,9 +25,9 @@
</div> </div>
@if (count($stats) > 0) @if (count($stats) > 0)
<div class="scrollbar-hide flex snap-x snap-mandatory gap-3 overflow-x-auto pb-2 sm:grid sm:grid-cols-3 sm:overflow-visible sm:pb-0 lg:gap-4" style="-ms-overflow-style:none;scrollbar-width:none;"> <div class="scrollbar-hide flex snap-x snap-mandatory gap-3 overflow-x-auto pb-2 sm:flex sm:flex-wrap sm:justify-end sm:overflow-visible sm:pb-0 lg:gap-4" style="-ms-overflow-style:none;scrollbar-width:none;">
@foreach ($stats as $stat) @foreach ($stats as $stat)
<div class="mobile-stats-card shrink-0 snap-start rounded-xl border border-slate-200 bg-white/90 px-4 py-3 text-center backdrop-blur-sm"> <div class="mobile-stats-card w-max min-w-[9rem] shrink-0 snap-start rounded-xl border border-slate-200 bg-white/90 px-4 py-3 text-center backdrop-blur-sm">
<p class="whitespace-nowrap text-xl font-bold text-slate-900 sm:text-2xl">{{ $stat['value'] }}</p> <p class="whitespace-nowrap text-xl font-bold text-slate-900 sm:text-2xl">{{ $stat['value'] }}</p>
<p class="mt-0.5 whitespace-nowrap text-[11px] font-medium text-slate-500">{{ $stat['label'] }}</p> <p class="mt-0.5 whitespace-nowrap text-[11px] font-medium text-slate-500">{{ $stat['label'] }}</p>
</div> </div>