Skip to content

Commit

Permalink
Add-ons store: Improve card sizing on desktop (#2859)
Browse files Browse the repository at this point in the history
Use grid instead of flex with a minimum card width and automatic sizing.
Looks nearly the same on smaller screens and much better on large
screens.

Also limit width of single add-on card in swiper component as a
safeguard.

---------

Signed-off-by: Florian Hotze <[email protected]>
  • Loading branch information
florian-h05 authored Nov 2, 2024
1 parent 7602f71 commit 1612d50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</div>
</template>
<template v-else-if="showAsCards">
<addons-swiper v-if="!$device.desktop && !$device.ipad && !canExpand" :addons-list="addonsList" :install-action-text="installActionText" @addonButtonClick="addonButtonClick" />
<addons-swiper v-if="!$device.desktop && !$device.ipad && (this.addons.length < this.addonCollapsedLimit)" :addons-list="addonsList" :install-action-text="installActionText" @addonButtonClick="addonButtonClick" />
<div v-else class="addons-cards">
<addon-card class="addon-card-desktop" v-for="addon in addonsList" :key="addon.uid" :addon="addon" :install-action-text="installActionText" @addonButtonClick="addonButtonClick" />
</div>
Expand Down Expand Up @@ -83,22 +83,9 @@
margin-top 1rem
.addons-cards
margin-top 1rem
display flex
flex-direction row
align-content flex-start
align-items flex-end
flex-wrap wrap
gap 10px
.addon-card-desktop
width 100%
@media (min-width: 481px)
width calc(50% - 10px)
@media (min-width: 768px)
width calc(33.333% - 10px)
@media (min-width: 1281px)
width calc(25% - 10px)
@media (min-width: 1601px)
width calc(20% - 10px)
display grid
grid-gap 10px
grid-template-columns repeat(auto-fill, minmax(200px, 1fr))
</style>

<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<style lang="stylus">
.addon-card-single
max-width 300px
width 66.667%
@media (orientation: landscape)
width 28.571%
Expand Down

0 comments on commit 1612d50

Please sign in to comment.