Hey folks,
I’ve gone through a few threads looking for answers — and I’ve found many (linked below — thank you!). Thanks to those, I can get things mostly looking the way I want. But there’s still one question I haven’t been able to solve.
It concerns the embed asset files, specifically the embed_HASH.css
file.
It appears that when these assets are built, they’re not compiled using the active theme’s color palette. That might be by design, or it might be something I’ve missed.
Here’s what I’d love clarity on:
- Is
embed_[digest].css
always built using the default palette?
If so, I can live with that — I know there’s a lot of ongoing work to improve how themes and color palettes are handled in Discourse. - If it can be built with a custom palette, how can I trigger that behavior?
- I’ve noticed it can be built using the system’s light or dark palettes, so it seems plausible that a custom palette could be used — but I haven’t been able to predictably generate a light or dark embed file.
To test this, I deleted all themes and palettes, set everything back to the default Light theme, and then ran:
rake assets:precompile
rake assets:precompile:build
…expecting to get a light-themed embed_HASH.css
. But the result still appeared to use dark styles.
I’m not deeply familiar with the internals, so I may be missing something obvious. If anyone could share what is required so that the embed_HASH.css
is built with a predictable palette, it would really help.
Thanks in advance!
FYI, my Discourse instance is running in Docker and it’s up to date. I’ve used the launcher
script and the standalone template.
Related reading (only 2 links allowed for new accounts, 3rd is a searchable title):
- How to customize appearance of discourse embeds?
- Styling of Embedded Discourse
- Automatic dark mode for embedded comments as well?