From what I see in the code, you can expect to see the following classnames:
is-staffis-adminis-moderatoris-new-usergroup--primary_group_name
You could create a group and set it as the primary group.
You can also use some code to add the missing class names.
import { apiInitializer } from "discourse/lib/api";
export default apiInitializer((api) => {
// Add the groups you wants to add
const allowedGroups = ["trust_level_4"];
api.modifyClass("components:chat/message/info", () => {
return class extends SuperClass {
@service currentUser;
get usernameClasses() {
if (!this.currentUser) {
return super.usernameClasses;
}
const allowedGroupClasses = this.currentUser.groups
.filter((g) => allowedGroups.includes(g.name))
.map((g) => `group--${g.name}`)
.join(" ");
return super.usernameClasses + " " + allowedGroupClasses;
}
}
})
});
Then you can CSS target with .group--trust_level_4.
Example:
.chat-message-info__username.group--trust_level_4 {
.chat-message-info__username__name {
color: blue;
}
}
For username, you don’t need the code above:
.chat-message-info__username.[data-user-card="username_here"] {
.chat-message-info__username__name {
color: red;
}
}
