Skip to content

Commit 5ecc417

Browse files
committed
style: improve library carousel card height
1 parent 32d40d1 commit 5ecc417

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

ak/homepage.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ def build_library_highlight_carousel(limit=3):
198198
"docs_url": get_documentation_url(lv, latest=True) if lv else "",
199199
}
200200
)
201+
slides.sort(
202+
key=lambda slide: (len(slide["description"]), len(slide["category_tags"])),
203+
reverse=True,
204+
) # sort by description length, then category count, to improve UI appearance
201205
return slides
202206

203207

static/css/v3/library-highlight-carousel.css

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105

106106
.library-highlight-carousel__card-head {
107107
display: flex;
108+
flex-wrap: wrap;
108109
align-items: flex-start;
109110
justify-content: space-between;
110111
gap: var(--space-medium);
@@ -139,9 +140,6 @@
139140
-webkit-line-clamp: 3;
140141
-webkit-box-orient: vertical;
141142
overflow: hidden;
142-
/* Always reserve 3 lines so every card resolves to the same fit-content
143-
height regardless of how long the description actually is. */
144-
height: calc(3 * var(--line-height-relaxed) * var(--font-size-small));
145143
}
146144

147145
/* ── Static meta row: "Added in" + dots ────────── */

0 commit comments

Comments
 (0)