mirror of
https://github.com/jcreek/LivingDexTracker.git
synced 2026-07-13 11:03:44 +00:00
feat(#48): Make box cells square on mobile
This commit is contained in:
@@ -533,7 +533,6 @@
|
|||||||
form={pokedexEntry.form}
|
form={pokedexEntry.form}
|
||||||
shiny={showShiny}
|
shiny={showShiny}
|
||||||
/>
|
/>
|
||||||
<span class="md:hidden">ⓘ</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div slot="tooltip">
|
<div slot="tooltip">
|
||||||
@@ -632,6 +631,13 @@
|
|||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
|
/*
|
||||||
|
On small screens the grid columns get narrow; without an explicit ratio,
|
||||||
|
the button height becomes content-driven (padding + sprite) and you end up
|
||||||
|
with rectangular cells. Force each slot to be square.
|
||||||
|
*/
|
||||||
|
aspect-ratio: 1 / 1;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pokemon-box--filtered-out {
|
.pokemon-box--filtered-out {
|
||||||
@@ -658,15 +664,53 @@
|
|||||||
.pokemon-box :global(img) {
|
.pokemon-box :global(img) {
|
||||||
width: var(--sprite-size, 64px);
|
width: var(--sprite-size, 64px);
|
||||||
height: var(--sprite-size, 64px);
|
height: var(--sprite-size, 64px);
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
display: block;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sprite-placeholder {
|
.sprite-placeholder {
|
||||||
width: var(--sprite-size, 64px);
|
width: var(--sprite-size, 64px);
|
||||||
height: var(--sprite-size, 64px);
|
height: var(--sprite-size, 64px);
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Mobile: keep 6 columns but prevent sprite/padding from forcing tall cells */
|
||||||
|
@media (max-width: 767px) {
|
||||||
|
.pokemon-box-inner {
|
||||||
|
/* cap padding so the sprite can fit inside small squares */
|
||||||
|
padding: min(var(--cell-padding, 1rem), 0.35rem);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pokemon-box :global(img) {
|
||||||
|
/* allow the sprite to shrink with the square cell */
|
||||||
|
width: min(var(--sprite-size, 64px), 100%);
|
||||||
|
height: min(var(--sprite-size, 64px), 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sprite-placeholder {
|
||||||
|
width: min(var(--sprite-size, 64px), 100%);
|
||||||
|
height: min(var(--sprite-size, 64px), 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-badge {
|
||||||
|
width: 0.95rem;
|
||||||
|
height: 0.95rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-badge-top {
|
||||||
|
top: 0.35rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-icon {
|
||||||
|
width: 0.85rem;
|
||||||
|
height: 0.85rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.status-badge {
|
.status-badge {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
Reference in New Issue
Block a user