Skip to content

Commit

Permalink
Small tweaks to lists-showcase
Browse files Browse the repository at this point in the history
  • Loading branch information
cdrini committed Jun 7, 2024
1 parent 9908275 commit 70e2272
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
10 changes: 8 additions & 2 deletions openlibrary/templates/lists/showcase.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,15 @@ <h2 class="home-h2">
</div>
<div class="list-showcase">
$if lists:
$ displayed_lists = lists[0:min(len(lists), 5)]
$for list in displayed_lists:
$ displayed_lists = 5
$for list in lists[:displayed_lists]
$:list_card(list)

$if len(lists) > displayed_lists:
<a
class="list-showcase__see-all cta-btn cta-btn--vanilla"
href="/people/$username/lists"
>$_("See all")</a>
$else:
<p>$_('You have no lists.')</p>
</div>
Expand Down
14 changes: 8 additions & 6 deletions static/css/components/list-showcase.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@
.list-showcase {
display: flex;
overflow-x: auto;
scrollbar-width: thin;
padding: 8px 0;
mask-image: linear-gradient(
to right,
rgba(0, 0, 0, 1) 0%,
rgba(0, 0, 0, 1) calc(100% - 100px),
rgba(0, 0, 0, 0) 100%
);

.list-card {
margin-right: 24px;
flex-shrink: 0;
}

&__see-all {
margin-right: 24px;
align-self: center;
width: auto;
}
}

Expand Down

0 comments on commit 70e2272

Please sign in to comment.