Styling Discourse with variables: A case for simpler semantics

The approach we took feels like it is along the lines of what you are describing, so I am having difficulty in understanding how you would have implemented them differently. Definitely open to feedback though and appreciate the perspective you are bringing.

For instance, for something like --space, changing this would change all spacing across the app. You could also target it to only affect spacing in the topic-list, or sidebar with similar approaches as you described.

This is true for some items, but not true for others. Any other examples you could share would be great!

This is for sure an issue. An approach we have in mind (at lest experimentally for now) is an editor along the lines of what shadcn is doin here:

Albeit it is not a perfect approach, I feel it would get us closer to making it easier for people who don’t know how to use the inspector / access meta for docs / use CSS.

As far as a more componentized approach, it’s something we eventually want to get to but Discourse as it stands was not built with componentized design in mind, and waiting to get there before adding in usable variables was not on the table.

Adding in some classes for this to be easier to implement in certain sections sounds like a nice path forward in usability.


I agree with you :+1:

2 Likes