Thanks to @Johani I found this great theme component made by @Falco Now all groups of a user are set in the body tag. I was searching for a solution but didn’t find any mention of this component.
https://github.com/discourse/discourse-groups-css-classes-in-body
I found a strange thing about the component (except admin user). When I add a user to a group, the body tag is not changing - a newly added group is not showed in the body tag.
I refreshed the page, logout, checked in incognito, switched between browsers, checked on different servers… nothing helps.
@Falco, can you please check the problem?
Update: the problem is caused because of the Visibility status of the chosen groups. I had set: Visible to group owners and Admin. That’s why the component couldn’t show the group name in the body tag. If I set to Visibility: Everyone - it started working correctly.
I think this is not a correct work of the component. Am I right?