Category color selection should be allowed even when style is "none"

In category settings, I see the message “You can’t select colors because you have a category style of none.” However, it’s used by the Category Icons theme component, and that works quite nicely with “none” as the style.

My current work-around is to change the style setting, quickly set the category color, and quickly set it back. But that’s kind of silly. Please just allow it to be set (maybe with a note that it won’t change the color unless a theme does something with it, instead of hiding the setting). Thanks!

1 Like

In the Category Icons component, you can use a HEX color for the icon. The icon color defaults to the category badge color only when using the special keyword “categoryColor”. Is there any reason you can’t use a HEX value in the theme component’s settings?

1 Like

I find it much nicer to maintain and manage the category colors in the category setting rather than in the components setting list — so categoryColor is perfect. (And as noted, it actually works with “none” as the style, I’m just prevented from editing it.)

1 Like

It does indeed work, but I hesitate to amend core when style none is set for categories given that the colors in the category settings will only be used if this theme component is installed and each row in its settings is set to default to categoryColor. In other words, it’s a very specific use case.

Plus, the preview in the category edit screen in core doesn’t include the theme component’s icon, so when choosing a color the user wouldn’t see any changes in the preview.

1 Like

It could be this theme component or any other that does something with category color, right? For example Discourse Category Banners or Colorful categories component. So I think it’s not really that narrow of a use case. And those don’t all have the work-around of a configuration option for the theme component.

1 Like

Oh, plus — I want to pick from the palette, and have the indicators show what’s taken already. That’s really nice! Can’t do that with the component hex color config.


I’d also like to make the point that it’s actually not such a specific use case.

Just as @mattdm already pointed out, the color is not only used in the badges or the icons. It can be used in banners and practically any page element when combined with the Colorful Categories component. Another advantage of using colors right from the category settings is that you enable community managers to change colors used in a theme themselves, rather then needing to reach out to the theme designer just for that.

Right now when you don’t want to use the core badges with colors, but still use category colors in other theme elements, the only way to change the category color is to enable a different badge style, change the color, then re-enable none as badge-style.

I saw @codinghorror mentioned this concern in another topic about it:

But as said, it can have many effects in a theme. Also, there’s a hint already, stating:

Screenshot from 2022-02-21 09-35-51

So why not keep the setting available and rather give a hint like:

:warning: You might not see colors because you have a category style of none.


Subject says it all.

…except that the colors one chooses are used in the Categories page, even when category-style is set to none. So I have keep changing the categories-style (box, bullet, bar), set color on new category, then set back to none :slight_smile:

Do you still want to be able to have those colors on the categories page, or would you prefer them to not appear at all?

I’d lean towards removing them to more broadly honor the “none” personally!

1 Like

I’d not really thought about it. I suppose if I had a real designer on staff, they’d tell me what I should think about that. ¯\_(ツ)_/¯

1 Like

I think I agree with Matthew and its OP here, I’m thinking of using the category color as background for an event in the upcoming calendar, but that might just be bad practice…

I would strongly prefer to keep the colors. The thing that is set to “none” is category style, which is described as “Visual style for category badges.” So “none” just means “no badges” — I don’t think it implies “no color”.

I mentioned that the badges are only place the colors are used in the default theming, but I think I’m actually wrong on that — the Categories page uses them too (as a bar along the left side of the category). (Am I crazy?)

I guess for consistency, maybe this setting should be renamed to something like category label style? [1]

  1. Not `category badge style, since “badges” are a different thing, and already ↩︎

1 Like

I suppose there’s not much harm to be done if we add the picker back to the “none” style and update the message to say something like “with the category badge style set to none, category colors will only be visible if called for in a theme”