FEATURE: allow groups to have configurable css properties for primary groups (PR #12747)

Allow primary groups to configure their own custom css properties. CSS Properties are in the form my-key:my-custom-value Properties are printed to primary group poster’s style in posts.

This allows themes to implement custom styling that is able to be general and leave specific styling details to each individual group.

eg:

A group with the following setting

important-group-image:background-image1-url
important-group-text:red

can be fed into a theme with the following styling:

.topic-post {
  color: var(--important-group-text);
  background-image: var(--important-group-image);
}

Then, later someone interested in creating a second group with similar styling with different assets/colors is able to create a group with the following css properties:

important-group-image: background-image2-url
important-group-text: blue

And posters with the new group set will automatically inherit styling from the theme with the new properties without any additional changes to themes.

This allows us to easily apply group post styling without having to know which groups we need to style beforehand.

Some examples in screenshots:

GitHub

This is interesting… but would using good old css classes also work? It feels like it would be simpler and also less data would be attached to each post (assuming a class could cover multiple CSS properties more easily).

This is probably going to be plugin-territory, but to answer the question –

Good ol’ classes can work in some cases - my thoughts on this were that anyone could build generic themes for styling, and these properties could be used to “fill in the blanks” for theme customization.

I suppose after thinking about it that in itself could also be a candidate for theme components as well (give a generic class here, and define your variables in a theme component); so now I’m conflicted :stuck_out_tongue: