# Discourse Category Headers theme component

**URL:** https://meta.discourse.org/t/discourse-category-headers-theme-component/148682
**Category:** Theme component
**Created:** [April 21, 2020, 1:02am UTC](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682 "2020-04-21T01:02:59Z")
**Posts on this page:** 20
**Page:** 9

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [October 23, 2025, 1:06am UTC](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/168 "2025-10-23T01:06:36Z")

</div>

Here’s the PR to support dark mode category logos:  
[https://github.com/naidihr/discourse-category-headers/pull/21](https://github.com/naidihr/discourse-category-headers/pull/21)

---

<div class="post-metadata">

### Author: ![ToddZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toddz/32/328350_2.png) [@ToddZ](https://meta.discourse.org/u/ToddZ)
#### Post date: [October 23, 2025, 11:04pm UTC](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/169 "2025-10-23T23:04:38Z")

</div>

> [@tknospdr](#):
>
> Minor request, can you make the ‘Read more’ link color the same as the rest of the text?  
> …  
> The rest of the text seems to auto select white or black based on the background color. Can you do that for the link too?

This bugged me a little too. A bit of custom CSS does the trick:

```plaintext
// let Category Headers Read More link use same color as summary text

.category-about-url a {
  color: inherit;

}

```

---

<div class="post-metadata">

### Author: ![ToddZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toddz/32/328350_2.png) [@ToddZ](https://meta.discourse.org/u/ToddZ)
#### Post date: [October 23, 2025, 11:26pm UTC](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/170 "2025-10-23T23:26:37Z")

</div>

My remaining wish for the “read more” link: show it only if more content actually exists. I have some long About category pages and some short ones, & I’d rather not offer a link to no added content.

(I have no idea if this is feasible. Might be a lot to ask of a TC.)

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [October 24, 2025, 3:27am UTC](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/171 "2025-10-24T03:27:42Z")

</div>

When the **full category description** is showing, I also encounter this on Theme Creator and on my dev instance. I’m looking into it. I suspect it’s because the route changes but the tracked variable does not.

UPDATE: I have added an expand/collapse functionality for category descriptions here. @nathank Also fixed the bug in:  
[https://github.com/naidihr/discourse-category-headers/pull/22](https://github.com/naidihr/discourse-category-headers/pull/22)

With a little nudge from Ask Discourse for using `willDestroy` with the router service.

---

<div class="post-metadata">

### Author: ![ToddZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toddz/32/328350_2.png) [@ToddZ](https://meta.discourse.org/u/ToddZ)
#### Post date: [October 24, 2025, 5:27am UTC](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/172 "2025-10-24T05:27:12Z")

</div>

Wow, Nate! 😮 55 commits and a PR in one evening… amazing.  
I’ll watch for a merge and look forward to trying it out!

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [October 24, 2025, 5:34am UTC](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/173 "2025-10-24T05:34:09Z")

</div>

A late morning for me, actually 😉. I’ll look into whether your suggestion about checking if the description has any more text is possible. I also felt myself needing that during my testing.

---

<div class="post-metadata">

### Author: ![jrgong](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jrgong](https://meta.discourse.org/u/jrgong)
#### Post date: [October 24, 2025, 9:51am UTC](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/174 "2025-10-24T09:51:21Z")

</div>

> [@NateDhaliwal](#):
>
> UPDATE: I have added an expand/collapse functionality for category descriptions here

This is a fantastic addition! ❤

Just one small point of feedback: It might make sense to add a chevron icon to the top right corner or right edge of the category header to indicate expand/collapse functionality to the users. But it’s a great starter, and for now using an emoji in link text as an indicator does the job:

 ![CleanShot 2025-10-24 at 11.50.33@2x](https://global.discourse-cdn.com/meta/original/4X/6/c/a/6cae3e71690e12eb5e67648d736c0b5a765a3f99.png)  
(Sidenote, maybe also add translations for the link text?

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [October 24, 2025, 10:05am UTC](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/175 "2025-10-24T10:05:07Z")

</div>

PR has been merged :git_merged: !

> [@jrgong](#):
>
> add a chevron icon to the top right corner or right edge of the category header to indicate expand/collapse functionality to the users

Got it 👍 . I’ll take a look.

---

<div class="post-metadata">

### Author: ![ToddZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toddz/32/328350_2.png) [@ToddZ](https://meta.discourse.org/u/ToddZ)
#### Post date: [October 25, 2025, 12:41am UTC](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/176 "2025-10-25T00:41:53Z")

</div>

Nate, the _read more/less_ functionality is excellent, thank you!

If there’s a way to condition that link on more text existing, that’d be great – but I could also just write longer descriptions 😆

I do see a couple issues you might not have had a chance to spot:

- category & tag links aren’t rendering their SVG icons
- the category image isn’t coming through so I’m getting the default site icon

> **(screenshot)**
>
> ![image](https://global.discourse-cdn.com/meta/original/4X/1/f/1/1f16a3f60c713c35127768f60ed12fe8c72abcd3.png)

A little thing I’ve managed to work around: links in the About text weren’t inheriting the text color, like the _read more_ link mentioned [earlier](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/169). This CSS styles the text links without affecting category and tag links:

```css
// text link styling, to exclude category and tag links
.category-title-header .category-title-description 
a:not([data-type="tag"], [data-type="category"]) {
  color: inherit;
  text-decoration: underline;
}

```

> **(screenshots)**
>
> ![image](https://global.discourse-cdn.com/meta/original/4X/0/0/0/000a94fb1c3692e4eb57a92052ffd286eedea386.png)  
> ![image](https://global.discourse-cdn.com/meta/original/4X/d/e/d/ded47ff7e39f5d7f2917ce0e68a57f6fdf68ce15.png)

I’m really impressed with the updates, & hope my SVG & icon issues are just a simple fix.

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [October 25, 2025, 2:55am UTC](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/177 "2025-10-25T02:55:54Z")

</div>

> [@ToddZ](#):
>
> category & tag links aren’t rendering their SVG icons

Interesting. Do you know if this was there previously?

> [@ToddZ](#):
>
> the category image isn’t coming through so I’m getting the default site icon

I’ll take a look. I also encountered this. Try disabling the `show site logo` setting in the meantime, that seems to fix it.

> [@ToddZ](#):
>
> links in the About text weren’t inheriting the text color, like the _read more_ link mentioned [earlier](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/169).

Thanks. Was this the case previously and some change occurred?

---

<div class="post-metadata">

### Author: ![ToddZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toddz/32/328350_2.png) [@ToddZ](https://meta.discourse.org/u/ToddZ)
#### Post date: [October 25, 2025, 3:23am UTC](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/178 "2025-10-25T03:23:27Z")

</div>

> Try disabling the `show site logo` setting in the meantime, that seems to fix it.

That works - thanks! I should have experimented with more settings.

As to the SVG link icons and text link colors, I can’t say what they might’ve done before – I never had links in the short summary part of the About text, but now there are some in the expanded ‘read more’.

(I shared that link-color CSS in case it was helpful to you or anyone, but I know that kind of styling tweaking isn’t necessarily the component’s responsibility.)

---

<div class="post-metadata">

### Author: ![ToddZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toddz/32/328350_2.png) [@ToddZ](https://meta.discourse.org/u/ToddZ)
#### Post date: [October 30, 2025, 7:32am UTC](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/179 "2025-10-30T07:32:36Z")

</div>

Nate, any thoughts on the issue with placeholder category/link SVG icons?

![image](https://global.discourse-cdn.com/meta/original/4X/4/7/6/476301bbb9122e5f64319090c2c4068eb72d62cc.png) ![image](https://global.discourse-cdn.com/meta/original/4X/6/b/5/6b53bd908076828530768714ba38e2989d1f2a5d.png)

I don’t know if there are differences in how they have to be coded in the header vs. in the topic, but what’s being output is quite different:

> **Category link comparison**
>
> Category link in header:  
> ![image](https://global.discourse-cdn.com/meta/original/4X/4/7/6/476301bbb9122e5f64319090c2c4068eb72d62cc.png)
> 
> ```html
> <a class="hashtag-cooked" href="/c/wild-speculations/5" data-type="category" data-slug="wild-speculations" data-id="5" data-style-type="square">
> <span class="hashtag-icon-placeholder">
> <svg class="fa d-icon d-icon-square-full svg-icon svg-node">
> <use href="#square-full"></use>
> </svg>
> </span>
> <span>Wild Speculations</span>
> </a>
> 
> ```
> 
> Category link in topic:  
> ![image](https://global.discourse-cdn.com/meta/original/4X/6/b/5/6b53bd908076828530768714ba38e2989d1f2a5d.png)
> 
> ```html
> <a class="hashtag-cooked" href="/c/wild-speculations/5" data-type="category" data-slug="wild-speculations" data-id="5" data-style-type="square" aria-label="Wild Speculations">
> <span class="hashtag-category-square hashtag-color--category-5"></span>
> <span>Wild Speculations</span>
> </a>
> 
> ```

and

> **Tag link comparison**
>
> Tag link in header:  
> ![image](https://global.discourse-cdn.com/meta/original/4X/f/9/e/f9ec9e11dcefa60f23ed997bee0d48c64a78645c.png)
> 
> ```html
> <a class="hashtag-cooked" href="/tag/ai" data-type="tag" data-slug="ai" data-id="5" data-style-type="icon" data-icon="tag">
> <span class="hashtag-icon-placeholder">
> <svg class="fa d-icon d-icon-square-full svg-icon svg-node">
> <use href="#square-full"></use>
> </svg>
> </span>
> <span>ai</span>
> </a>
> 
> ```
> 
> Tag link in topic:  
> ![image](https://global.discourse-cdn.com/meta/original/4X/6/1/2/6126aecaa536337e5658185b47c5a3c56a145dcd.png)
> 
> ```html
> <a class="hashtag-cooked" href="/tag/ai" data-type="tag" data-slug="ai" data-id="5" data-style-type="icon" data-icon="tag" aria-label="ai">
> <svg class="fa d-icon d-icon-tag svg-icon hashtag-color--tag-5 svg-string" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">
> <use href="#tag"></use>
> </svg>
> <span>ai</span>
> </a>
> 
> ```

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [October 30, 2025, 8:43am UTC](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/180 "2025-10-30T08:43:29Z")

</div>

I’ve been busy these few days (will get to it tomorrow). I suspect this is included in the category description. If you use the full description, does it still occur?

---

<div class="post-metadata">

### Author: ![ToddZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toddz/32/328350_2.png) [@ToddZ](https://meta.discourse.org/u/ToddZ)
#### Post date: [October 30, 2025, 9:26am UTC](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/181 "2025-10-30T09:26:29Z")

</div>

I appreciate that you’re volunteering your efforts, and I don’t mean to badger you. I Iooked into it to see if there’s something I could solve myself. (There’s not. 😳)

But yes, it still happens with `Show full category description` active.

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [October 30, 2025, 9:34am UTC](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/182 "2025-10-30T09:34:18Z")

</div>

I’ll try and see if there’s anything I can do. The last resort is to use some logic (which may be complicated) to adjust them based on colors (which may not account for icons). I’m open to suggestions if anyone has a better way.

@ToddZ If you look at [this example](https://meta.discourse.org/c/bug/1) of the official [Category Banners](https://meta.discourse.org/t/category-banners/86241) component (which I think Meta uses), it also has this problem.

---

<div class="post-metadata">

### Author: ![ToddZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toddz/32/328350_2.png) [@ToddZ](https://meta.discourse.org/u/ToddZ)
#### Post date: [October 30, 2025, 10:39am UTC](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/183 "2025-10-30T10:39:53Z")

</div>

> [@NateDhaliwal](#):
>
> the official [Category Banners](https://meta.discourse.org/t/category-banners/86241) component… also has this problem.

I see…! And someone mentions the problem:

> [@Category Banners](https://meta.discourse.org/t/category-banners/86241/234):
>
> This component works well with the category tag component but unfortunately is not compatible with the tag icon component. While tag icons function elsewhere on the site, they do not work in the description section. Is there a way to fix this?

I installed Category Banners to verify that category icons work – but they didn’t. Both category and tag icons get the placeholder, just as with Category Headers. And it’s the same regardless of the outlet chosen in the settings.

If there’s a way to just get them to process normally that’d be great, but I wouldn’t want you to resort to a complex workaround.

---

<div class="post-metadata">

### Author: ![jrgong](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jrgong](https://meta.discourse.org/u/jrgong)
#### Post date: [October 31, 2025, 11:34am UTC](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/184 "2025-10-31T11:34:38Z")

</div>

I just tested the compatibility with horizon theme. all in all it’s basically working, but the only issue is that the plugin outlet currently used by the category headers theme component is inside list-controls container on Horizon theme. Hence the whole category header stays sticky.

Suggested solution is to change the plugin outlet or add an option to choose a different plugin outlet outside list-controls container, e.g. `discovery-list-controls-above` outlet.

I can spin up a PR if you want @NateDhaliwal

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [November 1, 2025, 1:11am UTC](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/185 "2025-11-01T01:11:49Z")

</div>

Interesting. Thanks for bringing this up! I’ll look into this.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [January 23, 2026, 11:17am UTC](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/186 "2026-01-23T11:17:13Z")

</div>

I have submitted a PR for this theme component. I was a bit clumsy so it’s one PR with two different things 😭

- Feature: add a plugin outlet after the category title description
- Fix: the theme component did not use the S3 CDN for the background image

Could you have a look and merge please?

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [January 23, 2026, 11:24am UTC](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682/187 "2026-01-23T11:24:29Z")

</div>

Looks good! I’ve gone ahead to merge it. (Also, apologies for not seeing it earlier)

[Previous page](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682.md?page=8)

[Next page](https://meta.discourse.org/t/discourse-category-headers-theme-component/148682.md?page=10)
