# Styling based on group membership

**URL:** https://meta.discourse.org/t/styling-based-on-group-membership/12031
**Category:** Feature
**Created:** [January 17, 2014, 11:12pm UTC](https://meta.discourse.org/t/styling-based-on-group-membership/12031 "2014-01-17T23:12:35Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [January 17, 2014, 11:12pm UTC](https://meta.discourse.org/t/styling-based-on-group-membership/12031/1 "2014-01-17T23:12:35Z")

</div>

I think it would be pretty cool if we could get some CSS classes on posts based on what groups a user belongs to.

So, for example:

`<article class="boxed group-trust-level-2 group-bb-writers" ......>`

With a checkbox for whether or not the group shows up in the styling, in case we want private groups for some reason.

It would already be possible to do crazy CSS stuff with matching on `article[data-user-id=6626]`, but that would be very annoying to do for every user in the group.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 17, 2014, 11:19pm UTC](https://meta.discourse.org/t/styling-based-on-group-membership/12031/2 "2014-01-17T23:19:35Z")

</div>

For what purpose? Can you provide a visual mockup? Not clear what this would do, or be for.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [January 17, 2014, 11:32pm UTC](https://meta.discourse.org/t/styling-based-on-group-membership/12031/3 "2014-01-17T23:32:30Z")

</div>

Say, something like this:

 ![](https://global.discourse-cdn.com/meta/original/2X/4/494de2a1d753ccfa0314c6cccfed52e9c6189810.png) 

Which would be given with

```css
article.group-bb-writers div.topic-body {
    background-color: rgb(202, 233, 207);
}

```

The existing per-user customization, the highlighted name and title, might not be enough for some people: [Reddit - Please wait for verification](http://www.reddit.com/r/___/comments/131pv2/mutiny/)

(that subreddit is a little bit, ah, _crazy_ with its CSS customizations…)

```css
div.usertext-body div.md *:first-child::first-letter {
  text-transform: lowercase;
  text-decoration: underline;
}

```

---

<div class="post-metadata">

### Author: ![rafalp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rafalp/32/103814_2.png) [@rafalp](https://meta.discourse.org/u/rafalp)
#### Post date: [January 18, 2014, 1:36pm UTC](https://meta.discourse.org/t/styling-based-on-group-membership/12031/4 "2014-01-18T13:36:05Z")

</div>

> [@codinghorror](#):
>
> For what purpose? Can you provide a visual mockup? Not clear what this would do, or be for.

How about live site example, if I may? 😉 Blizzard uses extra styling to visually differ their employees posts and MVP’s from user ones:

> **[StarCraft II](https://starcraft2.blizzard.com/en-us/?page=9)**
>
> Wage war across the galaxy with three unique and powerful races. StarCraft II is a real-time strategy game from Blizzard Entertainment for the PC and Mac.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 18, 2014, 6:37pm UTC](https://meta.discourse.org/t/styling-based-on-group-membership/12031/5 "2014-01-18T18:37:11Z")

</div>

Right, we already have that in two forms – look at my post, and look at close / open / archive messages.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [January 18, 2014, 7:15pm UTC](https://meta.discourse.org/t/styling-based-on-group-membership/12031/6 "2014-01-18T19:15:16Z")

</div>

I’m not actually that experienced with CSS - is there actually a selector that would allow a forum to do that (set a background-image on the post) for everyone with a title?

 ![](https://global.discourse-cdn.com/meta/original/2X/c/c0e2b0de8fe24303ff72994a2975f8e378eb2f56.png)

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [December 4, 2025, 11:09am UTC](https://meta.discourse.org/t/styling-based-on-group-membership/12031/7 "2025-12-04T11:09:21Z")

</div>


