# 我想根据用户组成员资格自定义 UI

**URL:** <https://meta.discourse.org/t/i-want-to-customize-ui-based-on-the-users-group-membership/83786>\
**Category:** UX\
**Created:** [2018年三月16日 09:46 UTC](https://meta.discourse.org/t/i-want-to-customize-ui-based-on-the-users-group-membership/83786 "2018-03-16T09:46:12Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)\
**Post date:** [2018年三月16日 10:00 UTC](https://meta.discourse.org/t/i-want-to-customize-ui-based-on-the-users-group-membership/83786/2 "2018-03-16T10:00:04Z")

</div>

> [@Hide "NEW" for TL1 and above](https://meta.discourse.org/t/hide-new-for-tl1-and-above/83131/10):
>
> So the question occurs to me whether it would not be possible to make it so that certain CSS classes can be hidden or shown based on a user’s group membership, i.e. to allow site owners to customize their sites appearance for different users via CSS.

Yes, this is possible. The current primary group for a user is added as a CSS class on the `<body>` tag. This combined with the fact that Discourse supports SCSS means that you can apply different CSS styles based on the current user’s primary group easily.

If you have an example of something you’d like to do, I’d be happy to chime in.

---

_[View the full topic](https://meta.discourse.org/t/i-want-to-customize-ui-based-on-the-users-group-membership/83786)._
