Category Badge Styles

AI-generated summary

The discussion introduces Category Badge Styles, an official Discourse theme component that replaces the deprecated category_style admin setting. It allows users to configure category badges as box, bar, or none via a single site setting. The official announcement provides installation links, previews, and guidance for reporting bugs or requesting features.

AstonJ requested a feature to add specific #color values to the style attribute for finer control over foreground colors, asking if this could be done locally or added to the component. Jagster noted a potential side effect: if the badge style is set to โ€œnone,โ€ all new-style category icons are hidden.

Frenky presented Category Badge Styles EVO, an extended community version of the component. This fork offers greater flexibility with three independent settings (Main, Subcategory, and Topic List styles) and six display options (Box, Bar, None, Standard, Text, and Text Auto). Frenky shared the GitHub repository and expressed willingness to contribute these enhancements upstream if they would benefit the original project.

:discourse2: Summary Category Badge Styles replaces the functionality of the deprecated category_style admin setting
:eyeglasses: Preview Preview on Discourse Theme Creator (box)
Preview on Discourse Theme Creator (bar)
:hammer_and_wrench: Repository https://github.com/discourse/discourse-category-badge-styles
:question: Install Guide How to install a theme or theme component

Install this theme component

Features

With the changes to the category_style admin setting, the ability to set the category badge style to be box, bar, or none has been moved to this theme component. You can read more about that change here:

Examples

Settings

Only a single simple one for this:

Name Description
category badge style The desired style of the category badges

:discourse2: Hosted by us? Theme components are available to use on our Standard, Business, and Enterprise plans.

Last edited by @JammyDodger 2024-06-16T17:41:30Z

Check documentPerform check on document:
10 Likes

Just switched to this and have managed to get most of my styling back, however is it possible to add #color: FOREGROUND-COLOUR to the style attribute please?

So this:

Style Attribute {
--category-badge-color: #0;
--category-badge-text-color: #865ac9;
}

Would end up like this:

Style Attribute {
--category-badge-color: #0;
--category-badge-text-color: #865ac9;
color: #865ac9;
}

And so like this:

(Or is it possible for me to do this locally just on my install?)

Just another friendly remainder, but if this component is in use, and the badge style is nothing, it will hide all new style category icons.

Hi everyone!

First of all, thanks to the original developers of Category Badge Styles for this excellent theme component!

Iโ€™ve created an extended version called Category Badge Styles EVO, based on the original project.

While using the component on my Aprilia motorcycle community, I wanted more flexibility in how category badges appear in different parts of the forum.

The EVO version introduces three independent settings:

  • Main Category Badge Style

  • Subcategory Badge Style

  • Topic List Badge Style

Each setting offers six display options: Box, Bar, None, Standard, Text, and Text Auto.

The component was developed with AI assistance, based on my feature ideas and tested on my Discourse community.

You can find the project here:

Iโ€™d be happy to hear your thoughts. If these enhancements would be useful for the original component, Iโ€™d also be glad to contribute them upstream.

Thanks again for the great foundation!

Best regards,
Frenky
aForum โ€“ Aprilia Community