Skip to content

Commit 13521a5

Browse files
committed
Redesign category + tag filter UI: sidebar, popover, mobile sheets
Replaces the link-based subcategory/facet pill rows with a real client-side faceted filter, matching the attached design: - Desktop: a persistent 'Browse category' sidebar (subcategory list with static counts) + a 'Filters' button that opens a popover with one chip group per facet, an applied-filters chip row, and a live 'N resources' / 'Show N results' count. - Mobile: the sidebar and popover become two toolbar buttons that open bottom sheets — Browse category, and Filters (collapsible accordion groups, sticky Clear all / Show N results footer). - Filtering is now genuinely combinable (category AND every selected facet, OR within a facet's own values) and updates the grid live, instead of linking off to a separate taxonomy term page per click. - Category counts are still server-rendered per section (accurate, static); the live result count and card visibility are client-side, driven by a small per-section JSON payload embedded in the page (static/js/resource-filters.js) — no fetch, works progressively (full card grid is still real HTML/SEO-visible with no JS). - Card tag chips trimmed from up to 4 down to 2 (subcategory + one facet value), matching the design's card density. - Sections with no schema entry (Press & News) or no facets/subcategories yet (empty Member Directory) simply don't render the controls that wouldn't do anything — no dead buttons. Fixed two bugs while wiring this up: - The filters popover was positioned absolute against .resources-content (the whole scrollable card column) instead of the toolbar, so it rendered far below the fold — moved it inside a small relatively positioned wrapper around the Filters button. - Go's html/template auto-escapes script tag bodies as a JS string literal unless told otherwise, so the embedded JSON payload was double-encoded (a JSON string containing JSON, not an object) — piped through the safeJS template function to fix. Scope note: the old 'Year' filter row (event_year taxonomy) isn't part of the attached design and has been dropped from the UI; the taxonomy and its term pages still exist, just with no link pointing at them from the section page anymore.
1 parent 4777f9d commit 13521a5

6 files changed

Lines changed: 981 additions & 177 deletions

File tree

‎assets/scss/_light-theme.scss‎

Lines changed: 74 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,83 @@
260260
.taxonomy-term-name { color: #334155; }
261261
.taxonomy-term-count { color: #0272a5; background: rgba(0,200,255,0.08); }
262262

263-
.resource-filter-pill {
264-
border-color: transparent;
263+
// Category sidebar + faceted filters (redesign)
264+
.cat-item {
265265
color: #64748b;
266-
background: #eef2f7;
267-
&:hover { color: #334155; background: #e2e8f0; border-color: transparent; }
268-
&.active { color: #0272a5; background: rgba(0, 200, 255, 0.1); border-color: transparent; }
266+
&:hover { background: #f1f5f9; color: #0f172a; }
267+
&.cat-item--active { background: rgba(0, 200, 255, 0.08); color: #0272a5; }
268+
}
269+
.cat-count { color: #94a3b8; }
270+
.cat-item--active .cat-count { color: #0272a5; }
271+
272+
.filter-toolbar-count,
273+
.mobile-count { color: #64748b; }
274+
275+
.filter-btn,
276+
.toolbar-btn {
277+
background: #ffffff;
278+
border-color: #dde3ed;
279+
color: #0f172a;
280+
&:hover { border-color: rgba(0, 200, 255, 0.35); }
281+
&.filter-btn--active {
282+
border-color: rgba(0, 200, 255, 0.5);
283+
color: #0272a5;
284+
background: rgba(0, 200, 255, 0.08);
285+
}
286+
}
287+
288+
.badge { background: #0ea5e9; color: #ffffff; }
289+
290+
.applied-chip {
291+
border-color: rgba(0, 200, 255, 0.35);
292+
background: rgba(0, 200, 255, 0.08);
293+
color: #0272a5;
294+
}
295+
.applied-chips-clear {
296+
color: #64748b;
297+
&:hover { color: #0f172a; }
298+
}
299+
300+
.filters-popover,
301+
.bottom-sheet {
302+
background: #ffffff;
303+
border-color: #dde3ed;
304+
box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
305+
}
306+
307+
.filters-popover-header,
308+
.sheet-header { color: #0f172a; }
309+
310+
.popover-close {
311+
color: #94a3b8;
312+
&:hover { color: #0f172a; }
313+
}
314+
315+
.filters-clear-link {
316+
color: #64748b;
317+
&:hover { color: #0f172a; }
318+
}
319+
320+
.facet-group { border-bottom-color: #dde3ed; }
321+
.accordion-row { color: #0f172a; }
322+
.accordion-title { color: #94a3b8; }
323+
.accordion-chevron { color: #94a3b8; }
324+
325+
.chip {
326+
border-color: #dde3ed;
327+
color: #64748b;
328+
background: #ffffff;
329+
&:hover { color: #0f172a; border-color: rgba(0, 200, 255, 0.3); }
330+
&.chip--selected {
331+
border-color: rgba(0, 200, 255, 0.5);
332+
background: rgba(0, 200, 255, 0.08);
333+
color: #0272a5;
334+
}
269335
}
270336

337+
.sheet-handle { background: #dde3ed; }
338+
.sheet-footer { border-top-color: #dde3ed; }
339+
271340
.resource-count {
272341
background: rgba(0, 200, 255, 0.08);
273342
border-color: rgba(0, 200, 255, 0.2);

0 commit comments

Comments
 (0)