# Changing username colors

**URL:** https://meta.discourse.org/t/changing-username-colors/59056
**Category:** Support
**Created:** [2017 年 3 月 14 日午前 6:25 UTC](https://meta.discourse.org/t/changing-username-colors/59056 "2017-03-14T06:25:17Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Savage](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@Savage](https://meta.discourse.org/u/Savage)
#### Post date: [2017 年 3 月 14 日午前 6:25 UTC](https://meta.discourse.org/t/changing-username-colors/59056/1 "2017-03-14T06:25:17Z")

</div>

Is there currently any way to change the colors of usernames based on groups?  
For example, I want to make the usernames of Admins show up red when they post, and moderators purple when they post?

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [2017 年 3 月 14 日午前 7:01 UTC](https://meta.discourse.org/t/changing-username-colors/59056/2 "2017-03-14T07:01:43Z")

</div>

Yes you can do via CSS like below. But if you prioritized names in Discourse then only names will be colored. Also group must be chosen as “Primary Group” for that user.

```css
.topic-post .admin a {
color: red;
}

.topic-post .moderator a {
color: purple;
}

```

---

<div class="post-metadata">

### Author: ![dylanh724](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dylanh724/32/119642_2.png) [@dylanh724](https://meta.discourse.org/u/dylanh724)
#### Post date: [2019 年 5 月 27 日午後 1:15 UTC](https://meta.discourse.org/t/changing-username-colors/59056/6 "2019-05-27T13:15:18Z")

</div>

> [@vinothkannans](#):
>
> Yes you can do via CSS like below

Old bump, but super relevant – can I do the same css for custom groups? Eg, groups I made for Patreon linking I’d like to have a unique color.

---

<div class="post-metadata">

### Author: ![dylanh724](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dylanh724/32/119642_2.png) [@dylanh724](https://meta.discourse.org/u/dylanh724)
#### Post date: [2019 年 5 月 27 日午後 2:42 UTC](https://meta.discourse.org/t/changing-username-colors/59056/8 "2019-05-27T14:42:09Z")

</div>

Got it: Replace .admin .moderator with `group_name`, similarly. Or beyond just posts:

```css
// TOP TAKES PRIORITY
.names {
  span.someGroup a {
    color: #DC2E17;
  }
  span.someOtherGroup a {
    color: #DC2E17;
  }
}

```

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2022 年 11 月 15 日午前 5:06 UTC](https://meta.discourse.org/t/changing-username-colors/59056/10 "2022-11-15T05:06:21Z")

</div>

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