# Trouble using embedding in dark mode

**URL:** https://meta.discourse.org/t/trouble-using-embedding-in-dark-mode/274901
**Category:** Support
**Tags:** embedding
**Created:** [August 12, 2023, 1:19pm UTC](https://meta.discourse.org/t/trouble-using-embedding-in-dark-mode/274901 "2023-08-12T13:19:07Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [August 12, 2023, 3:43pm UTC](https://meta.discourse.org/t/trouble-using-embedding-in-dark-mode/274901/4 "2023-08-12T15:43:01Z")

</div>

Tried this but it seems to be broken:

> [@Automatic dark mode for embedded comments as well?](https://meta.discourse.org/t/automatic-dark-mode-for-embedded-comments-as-well/184347/10):
>
> I have implemented it by using postMessage. The codes and its execution logic are as blow: Code block ① adds an event listener in embedded Discourse iframe which will post message to my website that contains embedded Discourse iframe once embedded Discourse is loaded. When my website receives message from embedded Discourse, it will make a validation, as shown in code block ②, and if passed, call the setIframeStyle function to set embedded Discourse. The setIframeStyle function, ju…

---

_[View the full topic](https://meta.discourse.org/t/trouble-using-embedding-in-dark-mode/274901)._
