Can I use a theme I created without allowing it to be used by others?

Admins and moderators have the .staff class assigned to the page body, so you could do something like this in a theme:

body.staff {
  // your admin theme's css here
}

A normal user could add the class staff to their body tag (via the browser inspector) and see the theme too, but I’m not sure why anyone would bother trying that.

For more advanced themes, if you’re using a plugin outlet or changing html with template overrides (see Developer’s guide to Discourse Themes) you can do something like this:

{{#if currentUser.staff}}
  <h1>hello admins and moderators!</h1>
{{/if}}
4 Likes