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

Add basic JupyterLab theme support #2848

Merged
merged 2 commits into from
Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ include panel/index.ts
include panel/layout/*.html
include panel/models/*.ts
include panel/models/vtk/*.ts
include panel/_templates/*.css
include panel/_templates/*.js
include panel/_templates/*.html
include panel/tests/test_data/*.png
Expand Down
5 changes: 5 additions & 0 deletions panel/_templates/jupyter.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.bk-root, .bk-root .bk:before, .bk-root .bk:after {
font-family: var(--jp-ui-font-size1);
font-size: var(--jp-ui-font-size1);
color: var(--jp-ui-font-color1);
}
4 changes: 3 additions & 1 deletion panel/io/notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from ..compiler import require_components
from .embed import embed_state
from .model import add_to_doc, diff
from .resources import Bundle, Resources, _env, bundle_resources
from .resources import PANEL_DIR, Bundle, Resources, _env, bundle_resources
from .server import _server_url, _origin_url, get_server
from .state import state

Expand Down Expand Up @@ -260,8 +260,10 @@ def load_notebook(inline=True, load_timeout=5000):
bokeh.io.notebook.curstate().output_notebook()

# Publish comm manager
CSS = (PANEL_DIR / '_templates' / 'jupyter.css').read_text()
JS = '\n'.join([PYVIZ_PROXY, _JupyterCommManager.js_manager, nb_mime_js])
publish_display_data(data={LOAD_MIME: JS, 'application/javascript': JS})
publish_display_data(data={'text/html': f'<style>{CSS}</style>'})


def show_server(panel, notebook_url, port):
Expand Down