Show at most 4 categories, the rest behind a '+N' tag

- New partial/tag_list: first 4 categories, then a '+N' tag that opens
  the remaining ones (hover/keyboard on desktop, tap on touch screens;
  short close delay so the mouse can reach the list)
- Used on the homepage, the article page and the news overview / tag
  pages (the latter now use the same pills instead of text links)
- Article page: tag row grows when the tags wrap (was a fixed height)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
eric.busandClaude Opus 5.5 committed 2026-11-24 11:48:50 +01:00
1 parent f7b1dbac8f
commit df8c8a9c4f
10 files changed
+325 -32

No files matched your search

+7 -3
View File
@@ -140,7 +140,12 @@
.post_tags {
@include reset-list;
height: 31px;
// Grows with the tags when they wrap onto a second line (was a fixed 31px
// height with floats); the '+N' list (components/_tags.scss) opens below it
position: relative;
display: flex;
flex-wrap: wrap;
gap: 6px 10px;
margin: 20px 0;
a {
@@ -150,8 +155,7 @@
}
li {
float: left;
margin-right: 10px;
margin: 0;
a {
@extend %post-tags-link
+81
View File
@@ -0,0 +1,81 @@
// "+N" tag that opens the remaining categories of a news item
// (partial/tag_list.blade.php, resources/assets/js/functions/tags.js).
// The list is attached to the "+N" tag itself (right-aligned, extending to the
// left), so the mouse can move straight from "+N" into the list.
.tags_more {
position: relative;
.tags_more_toggle {
cursor: pointer;
}
.tags_more_list {
display: flex;
position: absolute;
right: 0;
top: 100%;
z-index: 30;
flex-wrap: wrap;
justify-content: flex-end;
gap: 4px;
width: max-content;
max-width: 240px;
margin: 0;
padding: 6px;
list-style: none;
border-radius: 12px;
background-color: var(--brand-surface);
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
// Hidden by default. Closing is delayed a little, so a diagonal mouse move
// from "+N" to a category further away doesn't close the list on the way.
visibility: hidden;
opacity: 0;
transition: opacity 0.15s ease 0.35s, visibility 0s linear 0.5s;
li {
float: none;
margin: 0;
}
}
// Devices with a mouse: open on hover and on keyboard focus (focus-within
// keeps it open while tabbing through the hidden tags). Not on touch screens:
// a tap would trigger a fake hover/focus there, so only a tap (.open, set by
// tags.js) opens and closes it.
@media (hover: hover) {
&:hover .tags_more_list,
&:focus-within .tags_more_list {
visibility: visible;
opacity: 1;
transition-delay: 0s;
}
}
&.open .tags_more_list {
visibility: visible;
opacity: 1;
transition-delay: 0s;
}
}
// Not enough room to the left of "+N" (set by tags.js): extend to the right
.tags_more--left .tags_more_list {
right: auto;
left: 0;
justify-content: flex-start;
}
// Homepage cards: the tags sit on the bottom edge of the image and the card
// clips anything outside it, so the list opens upwards over the image
.slider_content_box .tags_more .tags_more_list {
top: auto;
// Directly against "+N": a gap would close the list while moving the mouse to it
bottom: 100%;
}
// News overview cards (e.g. /nieuws/tag/...): a bit less space than on the article page
.blog .post .post_tags {
margin: 12px 0 6px;
}