jupyterlite / jupyterlite-sphinx

Sphinx extension using JupyterLite to render Notebooks
https://jupyterlite-sphinx.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
68 stars 21 forks source link

Provide a theme toggle plugin by default #124

Open martinRenou opened 10 months ago

martinRenou commented 10 months ago

Problem

As suggested in https://github.com/pydata/pydata-sphinx-theme/issues/745#issuecomment-1905560716

@jtpio just linked this in another thread https://jupyterlite.readthedocs.io/en/stable/howto/configure/advanced/iframe.html

It showcases an example making a jupyterlite plugin allowing to set the theme from outside of the iframe.

We could provide such a plugin by default in jupyterlite-sphinx, allowing pydata-sphinx-theme to notify jupytelite iframes of a potential theme change.

Not only We could support setting the theme using a theme name, but the message could probably also contain css variable values as a dictionary.