Skip to content

A platform for community discussion. Free, open, simple.

UX: make whole category box clickable (#18780)

Kris9c2f0edbec24
diff --git a/app/assets/javascripts/discourse/app/templates/components/categories-boxes-with-topics.hbs b/app/assets/javascripts/discourse/app/templates/components/categories-boxes-with-topics.hbs
index 5a3b241b2c3..3fa9f3e0e73 100644
--- a/app/assets/javascripts/discourse/app/templates/components/categories-boxes-with-topics.hbs
+++ b/app/assets/javascripts/discourse/app/templates/components/categories-boxes-with-topics.hbs
@@ -2,7 +2,7 @@
<div data-notification-level={{c.notificationLevelString}} style={{unless this.noCategoryStyle (html-safe (concat (border-color c.color) (category-color-variable c.color)))}} class="category category-box category-box-{{c.slug}} {{if c.isMuted "muted"}} {{if this.noCategoryStyle "no-category-boxes-style"}}">
<div class="category-box-inner">
<div class="category-box-heading">
- <a href={{c.url}}>
+ <a class="parent-box-link" href={{c.url}}>
{{#unless c.isMuted}}
{{#if c.uploaded_logo.url}}
<CategoryLogo @category={{c}} />
diff --git a/app/assets/stylesheets/common/base/category-list.scss b/app/assets/stylesheets/common/base/category-list.scss
index 3c267fdf1a6..d6c4154eb6a 100644
--- a/app/assets/stylesheets/common/base/category-list.scss
+++ b/app/assets/stylesheets/common/base/category-list.scss
@@ -275,6 +275,9 @@
.featured-topics {
margin-bottom: 1em;
+ // we absolutely position the parent category's link so the whole box is clickable
+ // to prevent this covering topic links, we need to raise the z-index
+ z-index: 1;
ul {
color: var(--primary-medium);
list-style: none;