-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Scope CSS rules to a new .jp-ThemedContainer class
#16519
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
Conversation
|
Thanks for making a pull request to jupyterlab! |
|
cc @echarles |
|
To reduce friction with third party extensions, I could set the new class |
|
bot please update galata snapshots |
|
Galata snapshots updated. |
.jp-ThemedContainer class
krassowski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some comments and question on the migration guide.
| you should add the class ``jp-ThemedContainer`` to the DOM elements added outside the application shell. | ||
| - DOM elements ``code``, ``kbd``, ``pre``, ``samp`` and ``tt`` may have broken styles. To fix this, | ||
| prepend the class ``.jp-ThemedContainer`` to your rule; e.g. | ||
| ``.jp-Inspector-content pre`` becomes ``.jp-ThemedContainer .jp-Inspector-content pre`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it still accurate after adding .jp-ThemedContainer to the body? Or does it only pertain custom shells?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
galata/test/benchmark/notebook.spec.ts-snapshots/large-md-notebook-ipynb-benchmark-linux.png
Show resolved
Hide resolved
49b30b4 to
bb3b220
Compare
* Scope CSS rules to .jp-ThemedContainer class * Fix examples and some missed floating widgets * Add migration note * Add class jp-ThemedContainer on the JupyterLab application shell container * Move the themed container in the template to limit contamination when reusing `JupyterLab`. * Fix bug in notification status bar item * Don't scope rule if it uses a jp class * Fix pre/tt/code/samp/kbd specificity * Reduce unneeded specificity as the rule already uses a jp class * Update migration doc * Fix CSS specificity for code tag in html * Fix examples * Fix cell example bg * Update Playwright Snapshots * Second attempt to fix cell bg * Restore bg color for main too * [skip ci] Improve doc wording Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com> * Fix Markdown code block rendering * Revert unwanted snapshot change --------- Co-authored-by: Frédéric Collonval <fcollonval@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
References
Fixes #15320
Fixes #8652
Fixes #5867
Fixes #13493
It will also ease the integration of all or part of JupyterLab in third-party applications.
Code changes
Add a new class
.jp-ThemedContainerto all DOM element requiring to be Jupyter styledAll global CSS rules are now scoped behind that new class
User-facing changes
None
Backwards-incompatible changes
Any extension that attach a DOM node outside the shell may loose part of its styling.The fix is to add the new class[should be ok as body is tagged as themed container]jp-ThemedContainerThe theme now have scoped rule on
tt,code,pre,sampandkbdtag. This increases the specificity of the selector and as it is applied later (due to the injection of the theme style sheet), it may impact the look and feel of those tags in extensions.The fix is to add the new class
.jp-ThemedContainerbefore the existing rule; e.g..jp-Inspector-content pre➡️.jp-ThemedContainer .jp-Inspector-content pre