kirupa
(Kirupa Chinnathambi)
September 25, 2022, 8:29pm
1
Hi everyone,
I use the discourse embed feature to surface posts on a non-discourse site. When I have dark mode on the main site enabled, I would like to style the discourse embeds to appear appropriately as well:
Is there a way for me to have the embedded instance inherit the styles from the parent page? I believe it is iframed right now, and that is limiting style sharing.
Thanks,
Kirupa
kirupa
(Kirupa Chinnathambi)
September 28, 2022, 3:25am
2
Another thing is that the code syntax highlighting is also missing. Is there a way to make the embed look more natural with the site it is being displayed in while also retaining syntax highlighting?
I think the auto-dark embeds has cropped up before if this is any use:
Automatic Dark Mode color scheme switching is a fantastic addition, thanks for integrating it!
With (automatic) color scheme switching available, I’m wondering if there might also be some way to switch back and forth between light and dark Discourse modes when embedded as comments in a blog. Specifically, my Ghost blog has a toggle that users can click on to manually switch back and forth between light and dark modes. I know that my blog’s CSS can’t effect the CSS within Discourse’s iframe, but…
weallwegot
(juicecounty.prodigy)
September 28, 2022, 4:00am
4
And as another potential helpful thread there are a few CSS pointers here, though I haven’t done it myself:
How to style the embedded Discourse frame on your web page
Getting Started
To get started you have to create a new CSS stylesheet under admin -> customize -> css/html, even if you don’t want to change the normal styling of your forum. Just leave the other categories empty and just modify Embedded CSS. Don’t forget to set it to enabled under the textfield.
Link and Button Colors
You probably want to style the links and buttons according to your web page.
footer a.button {
background-color: …
2 Likes
kirupa
(Kirupa Chinnathambi)
October 6, 2022, 2:10am
5
Thanks so much for the suggestions! I’ll try setting custom CSS via the approach you have described
system
(system)
Closed
November 5, 2022, 2:11am
6
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.