File: jupyter_css.py

package info (click to toggle)
python-trame 3.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 101,620 kB
  • sloc: python: 13,515; sh: 183; javascript: 93; makefile: 7
file content (22 lines) | stat: -rw-r--r-- 503 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from IPython.display import HTML, display_html

display_html(
    HTML("""
        <style>
        .jp-LinkedOutputView .jp-OutputArea-child:has(iframe[id*='trame__template']) {
        height: 100%;
        }
        </style>
        """)
)


def fullscreen(app_or_ui):
    original = app_or_ui
    if hasattr(app_or_ui, "ui"):
        app_or_ui = app_or_ui.ui

    if hasattr(app_or_ui, "iframe_style"):
        app_or_ui.iframe_style = "border: none; width: 100%; height: 100%;"

    return original