Let hero stats cards auto-expand to fit long values.
Deploy Ladill Care / deploy (push) Successful in 1m14s

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:52:56 +00:00
parent 387d7e900f
commit 8ada6eb033
2 changed files with 12 additions and 6 deletions
+8 -2
View File
@@ -101,7 +101,10 @@ html.qr-mobile-page body {
}
.mobile-stats-card {
width: calc(66.666667% - 0.5rem);
width: max-content;
min-width: 9rem;
max-width: none;
box-sizing: border-box;
}
@layer components {
@@ -334,7 +337,10 @@ html.qr-mobile-page body {
@media (min-width: 640px) {
.mobile-stats-card {
width: auto;
width: max-content;
min-width: 9rem;
max-width: none;
flex: 1 1 auto;
}
}
@@ -25,11 +25,11 @@
</div>
@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)
<div class="mobile-stats-card flex w-[8.5rem] shrink-0 snap-start flex-col justify-center rounded-xl border border-slate-200 bg-white/90 px-3 py-3 text-center backdrop-blur-sm sm:w-auto sm:min-w-0">
<p class="truncate text-lg font-bold tabular-nums text-slate-900 sm:text-xl" title="{{ $stat['value'] }}">{{ $stat['value'] }}</p>
<p class="mt-0.5 truncate text-[11px] font-medium text-slate-500" title="{{ $stat['label'] }}">{{ $stat['label'] }}</p>
<div class="mobile-stats-card flex w-max min-w-[9rem] shrink-0 snap-start flex-col justify-center rounded-xl border border-slate-200 bg-white/90 px-4 py-3 text-center backdrop-blur-sm">
<p class="whitespace-nowrap text-lg font-bold tabular-nums text-slate-900 sm:text-xl" title="{{ $stat['value'] }}">{{ $stat['value'] }}</p>
<p class="mt-0.5 whitespace-nowrap text-[11px] font-medium text-slate-500" title="{{ $stat['label'] }}">{{ $stat['label'] }}</p>
</div>
@endforeach
</div>