voila-dashboards / voici

Voici turns any Jupyter Notebook into a static web application
https://voici.readthedocs.io/
Other
156 stars 9 forks source link

Fetch theme name from the body data attribute #63

Closed jtpio closed 1 year ago

jtpio commented 1 year ago

References

This should help mitigate https://github.com/voila-dashboards/voici/issues/36.

Code changes

Read data-jp-theme-name which may be available on the page already if set by a template.

User-facing changes

There might still be a flickering effect, but the --theme value should persist.

Below is a screencast of a voici app built with: voici build --contents notebooks --theme=dark

https://user-images.githubusercontent.com/591645/231776577-f9c665d7-3c03-4a90-89f1-4fb865c0962c.mp4

image

Backwards-incompatible changes

None

github-actions[bot] commented 1 year ago

lite-badge :point_left: Try it on ReadTheDocs

jtpio commented 1 year ago

Maybe a proper fix would be to populate a default overrides.json as part of the build step in the addon, with the following content based on the --theme value:

{
  "@jupyterlab/apputils-extension:themes": {
    "theme": "JupyterLab Dark"
  }
}

Could be investigated as a follow-up.