Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for dark mode #8

Open
amotl opened this issue Jan 27, 2025 · 3 comments
Open

Support for dark mode #8

amotl opened this issue Jan 27, 2025 · 3 comments
Labels
question Further information is requested

Comments

@amotl
Copy link

amotl commented Jan 27, 2025

Dear @attakei,

@simonprickett reviewed the docs page 1 where we are enumerating a few use case examples of oEmbedPy/Sphinx. Within our Sphinx theme, which is building upon sphinx-basic-ng and Furo, users can choose to select dark mode for display.

In this mode, it becomes apparent that oEmbedPy's HTML/CSS output might not consider dark mode, yet.

Image

Would it be something that could be improved?

With kind regards,
Andreas.

/cc @msbt

Footnotes

  1. https://crate-docs-theme.readthedocs.io/en/latest/myst/oembed.html

@attakei attakei added the question Further information is requested label Jan 29, 2025
@attakei
Copy link
Owner

attakei commented Jan 31, 2025

I don't know for this and think that it is difficult.
Because your pages and embedded contents are from different origin, then we cannot almost control contents as far as I know.

It maybe can handle by outside depending to format, but responded html are not same, and it is hard to support all.

@amotl
Copy link
Author

amotl commented Jan 31, 2025

Hi Kazuya,

thanks for your reply. I see that it may become difficult. Maybe @msbt has a good idea?

With kind regards,
Andreas.

@msbt
Copy link

msbt commented Feb 3, 2025

For some embeds it's easy enough to just add a &theme=dark parameter, like reddit. Twitter/X comes with &theme=light by default, so this would need to be found and replaced. Bluesky doesn't seem to have a dark-mode just yet. So in theory we could whip up some js magic to check which data-theme is set on html/body and attach that value to the iframe. Not the cleanest solution (because it requires re-rendering after the page was loaded), but it could be a start:

Image

Unrelated: No idea why X has those white borders

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants