Show/hide themes for specific groups?

You can achieve this in a basic way with CSS… here’s how I’d go about it:

  1. Assign Patreon tiers to groups, these groups must have automatically set as primary group enabled

  2. Add all the user-selectable themes you want to make available

  3. You can now hide theme options from user preferences using CSS because primary groups are appended to the body tag, and you can target theme options in the dropdowns via data attributes. You’ll want to add this CSS to a theme component and add the component to all of your themes.

So for example if I wanted to hide a theme named “Dark Theme” from everyone except those in the Staff group, I could do this:

body:not(.staff) { 
  .user-preferences .select-kit-row[data-name="Dark Theme"] {
      display: none;
  }
}

So now “Dark Theme” wouldn’t appear in the user preferences dropdown unless you’re in the staff group.

Someone could figure out a way to dig around in the web inspector and enable these themes, but I imagine most people wouldn’t even look.


All that being said, for the future I think we should definitely consider some “monetization” features that would enable an admin to easily incentivize support with themes, titles, sets of emoji… etc.

15 Likes