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

HTMLManager: Do not reset lab's CSS variables if they are defined #3342

Merged
merged 1 commit into from
Jan 11, 2022

Conversation

martinRenou
Copy link
Member

Do not override the JupyterLab's CSS variables if they are already defined in the page.
This fixes the nbconvert's HTMLExporter when using a dark theme.

Testing it:

jupyter nbconvert --to html --HTMLExporter.theme=dark --HTMLExporter.template_name=lab --HTMLExporter.widget_renderer_url=/path/to/local/ipywidgets/packages/html-manager/dist/embed-amd.js NotebookWithWidgets.ipynb

Screenshot:

dark

References:

Fix #3340 fix jupyter/nbconvert#1506

@github-actions
Copy link

Binder 👈 Launch a binder notebook on branch martinRenou/ipywidgets/fix_html_manager_css

@martinRenou
Copy link
Member Author

martinRenou commented Jan 11, 2022

As a side note, I wonder if this logic should not be in the base-manager so that we get it for free in any manager (thinking about Voila for example, which does not use the html-manager and needs to manually inject lab variables in the classic theme).

@maartenbreddels
Copy link
Member

See also #2534

@martinRenou
Copy link
Member Author

Thanks for the pointer! I didn't see your PR

@maartenbreddels
Copy link
Member

Yeah, I also had trouble finding it, but I remember trying to attack a similar issue.

@jasongrout
Copy link
Member

Thanks!

@martinRenou
Copy link
Member Author

meeseeksdev backport to 7.x

@jasongrout jasongrout merged commit bc7c589 into jupyter-widgets:master Jan 11, 2022
meeseeksmachine pushed a commit to meeseeksmachine/ipywidgets that referenced this pull request Jan 11, 2022
@martinRenou martinRenou deleted the fix_html_manager_css branch January 11, 2022 18:35
martinRenou added a commit that referenced this pull request Jan 12, 2022
…2-on-7.x

Backport PR #3342 on branch 7.x (HTMLManager: Do not reset lab's CSS variables if they are defined)
@jasongrout jasongrout added this to the 8.0 milestone Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants