Can you change the color of customizable text?

For instance. %{count} unread can be changed to say whatever I want but can I make unread another color?

Or can I add a background color like the box that surrounds tags?

Thanks.

You would need CSS.

You need to look at theme developers

2 Likes

Can you point me in the direction of some sample CSS that would do this, please?

Or a specific topic in theme developers?

Thanks.

Do I understand correctly that you want to change the word and not the number?

Please read the guides:

Yes. And I’d like to do it from the custom text feature. I want “Unread” to be red. If I have to add it to the CSS in the default theme, I’ll try. But again, I’d rather do it form the customized text section.

But, I don’t want to create a theme. I want to color 1 word that’s in custom text.

ETA: I did look through the link you provided. That seems like an awful lotta trouble to change 1 word. If the only way is to create a new theme, it’s not that big of a deal to me. :grinning:

Yep so adding CSS is what you have to do if you want to change the color and style of words. The Customised Text section is just for changing the content of the text itself, not its style.

Instead of adding CSS directly to the default theme though, Discourse has theme components which allows you to add CSS on top of an existing theme.

Just to be clear about expectations, Meta is not a dedicated support site for a complete guide to getting started with CSS (just like it is not a dedicated support site for learning Ruby and JavaScript completely from scratch, if you wanted to start customising the behaviour of Discourse through plugins). If you want to customise the appearance of Discourse, you will need to learn more about CSS.

So there are guides on making theme components and plugins for Discourse here, but not for learning CSS or Ruby from scratch (since that’s a general skill). Sometimes people have time to kindly help, but it’s not always going to be possible, because it means having to go through general HTML & CSS knowledge – the basics of the Inspector and classes and properties etc.

Here is an intro guide to making CSS changes on your site:

4 Likes

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.