# Set theme dynamically on landing

**URL:** https://meta.discourse.org/t/set-theme-dynamically-on-landing/156506
**Category:** Feature
**Created:** [July 1, 2020, 5:47pm UTC](https://meta.discourse.org/t/set-theme-dynamically-on-landing/156506 "2020-07-01T17:47:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mosesoak](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@mosesoak](https://meta.discourse.org/u/mosesoak)
#### Post date: [July 1, 2020, 5:47pm UTC](https://meta.discourse.org/t/set-theme-dynamically-on-landing/156506/1 "2020-07-01T17:47:15Z")

</div>

Hi, I’m an experienced dev but totallly new to Discourse, will be using on a project and currently planning on light/dark user themes.

The forum will be a subdomain of another app, where the user will be able to toggle dark mode. My question is, does Discourse provide a way for us to pass the current user theme when they access the forum, for a seamless experience?

If so, is there a common mechanism for communicating back to the parent site if the user changes the theme within the forum?

Hoping this is a problem that’s been solved before, and doesn’t require custom functionality. Thanks!

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [July 1, 2020, 5:55pm UTC](https://meta.discourse.org/t/set-theme-dynamically-on-landing/156506/2 "2020-07-01T17:55:17Z")

</div>

Are you using sso? You might pass a group for the dark theme and then use that group to modify the theme component.

---

<div class="post-metadata">

### Author: ![mosesoak](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@mosesoak](https://meta.discourse.org/u/mosesoak)
#### Post date: [July 1, 2020, 6:14pm UTC](https://meta.discourse.org/t/set-theme-dynamically-on-landing/156506/3 "2020-07-01T18:14:58Z")

</div>

Yes, that’s a thought, maybe we could re-authenticate and pass user prefs that get packed into the jwt.

Assuming we can get that information to the forum through that or a query parameter, what would be the normal way to consume that information and set the user theme prior to the initial render?
