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

Change background color of output cell in JupyterLab #14163

Open
paoloalba opened this issue Mar 10, 2023 · 8 comments
Open

Change background color of output cell in JupyterLab #14163

paoloalba opened this issue Mar 10, 2023 · 8 comments
Labels
enhancement tag:CSS For general CSS related issues and pecadilloes

Comments

@paoloalba
Copy link

paoloalba commented Mar 10, 2023

Description

I am using pygments to highlight some syntax in a jupyter notebook

Reproduce

Here a minimal code to reproduce the issue:

from IPython.display import display, HTML
from pygments import highlight
from pygments.lexers import SqlLexer
from pygments.formatters import HtmlFormatter

from helpers.mystyle import GhDarkStyle

fmtter = HtmlFormatter(style=GhDarkStyle)

query = """
SELECT
   *
FROM
   latest.tmp
"""
display(
    HTML(
        '<style type="text/css">{}</style>    {}'.format(
            fmtter.get_style_defs(".highlight"), highlight(query, SqlLexer(), fmtter)
        )
    )
)

the style I use is just a copy from the official pygments repo (https://github.com/pygments/pygments/blob/master/pygments/styles/gh_dark.py) in order to have better control on the elements.

Expected behavior

The output of the display is correct running the code in a classical jupyter notebook:
output_jupyter_notebooks

but it fails within jupyter lab:
output_jupyterlab

Comments

I tried to patch the css style myself, but I was unable to find the correct css-class to apply the background to.

Context

  • pygments: 2.14.0
  • jupyter-lab: 3.5.3
  • in general everything contained in jupyter/scipy-notebook:python-3.10.8 docker image
  • I tried it on several Edge and Chrome
@paoloalba paoloalba added the bug label Mar 10, 2023
@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label Mar 10, 2023
@welcome
Copy link

welcome bot commented Mar 10, 2023

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@JasonWeill JasonWeill added enhancement tag:CSS For general CSS related issues and pecadilloes and removed bug labels Mar 10, 2023
@andrii-i
Copy link
Contributor

@paoloalba when trying to reproduce, vanilla JupyterLab doesn't have all the required packages. Could you please run jupyter labextension list and jupyter troubleshoot and post outputs here?

Full disclosure: we can only help with JupyterLab-related issues so if this problem due to changes in pygments implementation or in interplay of pygments with some extensions, we might not be able to help

@JasonWeill
Copy link
Contributor

@paoloalba What are you seeing and what are you expecting, specifically? Can you tell us the styles that you're expecting to see and what's actually getting applied? I'm not sure whether this is a bug in JupyterLab.

@paoloalba
Copy link
Author

@paoloalba when trying to reproduce, vanilla JupyterLab doesn't have all the required packages. Could you please run jupyter labextension list and jupyter troubleshoot and post outputs here?

Full disclosure: we can only help with JupyterLab-related issues so if this problem due to changes in pygments implementation or in interplay of pygments with some extensions, we might not be able to help

here the outputs:
JupyterLab v3.5.3
/opt/conda/share/jupyter/labextensions
jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments)
jupyter-matplotlib v0.11.2 enabled OK
@jupyter-widgets/jupyterlab-manager v5.0.5 enabled OK (python, jupyterlab_widgets)

InvalidVersionSpec: Invalid version '(>=': unable to convert to expression tree: ['(']

$PATH:
/opt/conda/bin
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin

sys.path:
/opt/conda/bin
/opt/conda/lib/python310.zip
/opt/conda/lib/python3.10
/opt/conda/lib/python3.10/lib-dynload
/opt/conda/lib/python3.10/site-packages

sys.executable:
/opt/conda/bin/python

sys.version:
3.10.8 | packaged by conda-forge | (main, Nov 22 2022, 08:26:04) [GCC 10.4.0]

platform.platform():
Linux-5.15.49-linuxkit-x86_64-with-glibc2.35

which -a jupyter:
/opt/conda/bin/jupyter

pip list:
Package Version
----------------------------- -----------
alembic 1.9.1
altair 4.2.0
anyio 3.6.2
appdirs 1.4.4
argon2-cffi 21.3.0
argon2-cffi-bindings 21.2.0
asttokens 2.2.1
async-generator 1.10
attrs 22.2.0
Babel 2.11.0
backcall 0.2.0
backports.functools-lru-cache 1.6.4
beautifulsoup4 4.11.1
black 23.1.0
bleach 6.0.0
blinker 1.5
bokeh 2.4.3
Bottleneck 1.3.6
brotlipy 0.7.0
cached-property 1.5.2
certifi 2022.12.7
certipy 0.1.3
cffi 1.15.1
charset-normalizer 2.1.1
click 8.1.3
cloudpickle 2.2.1
colorama 0.4.6
comm 0.1.2
conda 22.11.1
conda-package-handling 2.0.2
conda_package_streaming 0.7.0
contourpy 1.0.7
cryptography 39.0.0
cycler 0.11.0
Cython 0.29.33
cytoolz 0.12.0
dask 2023.1.1
debugpy 1.6.6
decorator 5.1.1
defusedxml 0.7.1
dill 0.3.6
distributed 2023.1.1
entrypoints 0.4
et-xmlfile 1.1.0
executing 1.2.0
fastjsonschema 2.16.2
flit_core 3.8.0
fonttools 4.38.0
fsspec 2023.1.0
gmpy2 2.1.2
greenlet 2.0.2
h5py 3.8.0
HeapDict 1.0.1
idna 3.4
imagecodecs 2023.1.23
imageio 2.25.0
importlib-metadata 6.0.0
importlib-resources 5.10.2
ipykernel 6.20.2
ipympl 0.9.2
ipython 8.9.0
ipython-genutils 0.2.0
ipywidgets 8.0.4
jedi 0.18.2
Jinja2 3.1.2
joblib 1.2.0
json5 0.9.5
jsonschema 4.16.0
jupyter_client 7.4.9
jupyter_core 5.1.5
jupyter-events 0.6.3
jupyter_server 2.1.0
jupyter_server_terminals 0.4.4
jupyter-telemetry 0.1.0
jupyterhub 3.1.1
jupyterlab 3.5.3
jupyterlab-pygments 0.2.2
jupyterlab_server 2.16.6
jupyterlab-widgets 3.0.5
kiwisolver 1.4.4
libmambapy 1.2.0
llvmlite 0.39.1
locket 1.0.0
lz4 4.2.0
Mako 1.2.4
mamba 1.2.0
MarkupSafe 2.1.2
matplotlib 3.6.3
matplotlib-inline 0.1.6
mistune 2.0.4
mpmath 1.2.1
msgpack 1.0.4
munkres 1.1.4
mypy-extensions 1.0.0
nb-black 1.0.7
nbclassic 0.4.8
nbclient 0.7.2
nbconvert 7.2.9
nbformat 5.7.3
nest-asyncio 1.5.6
networkx 3.0
notebook 6.5.2
notebook_shim 0.2.2
numba 0.56.4
numexpr 2.8.3
numpy 1.23.5
oauthlib 3.2.2
openpyxl 3.0.10
packaging 23.0
pamela 1.0.0
pandas 1.5.3
pandocfilters 1.5.0
parso 0.8.3
partd 1.3.0
pathspec 0.11.0
patsy 0.5.3
pexpect 4.8.0
pickleshare 0.7.5
Pillow 9.4.0
pip 22.3.1
pkgutil_resolve_name 1.3.10
platformdirs 2.6.2
pluggy 1.0.0
pooch 1.6.0
prometheus-client 0.16.0
prompt-toolkit 3.0.36
protobuf 4.21.12
psutil 5.9.4
ptyprocess 0.7.0
pure-eval 0.2.2
pycosat 0.6.4
pycparser 2.21
pycurl 7.45.1
Pygments 2.14.0
PyJWT 2.6.0
pyOpenSSL 23.0.0
pyparsing 3.0.9
pyrsistent 0.19.3
PySocks 1.7.1
python-dateutil 2.8.2
python-json-logger 2.0.4
pytz 2022.7.1
PyWavelets 1.4.1
PyYAML 6.0
pyzmq 25.0.0
requests 2.28.2
rfc3339-validator 0.1.4
rfc3986-validator 0.1.1
ruamel.yaml 0.17.21
ruamel.yaml.clib 0.2.7
scikit-image 0.19.3
scikit-learn 1.2.1
scipy 1.10.0
seaborn 0.12.2
Send2Trash 1.8.0
setuptools 66.1.1
six 1.16.0
sniffio 1.3.0
sortedcontainers 2.4.0
soupsieve 2.3.2.post1
SQLAlchemy 2.0.0
stack-data 0.6.2
statsmodels 0.13.5
sympy 1.11.1
tables 3.7.0
tblib 1.7.0
terminado 0.17.1
threadpoolctl 3.1.0
tifffile 2023.1.23.1
tinycss2 1.2.1
tomli 2.0.1
toolz 0.12.0
tornado 6.2
tqdm 4.64.1
traitlets 5.8.1
typing_extensions 4.4.0
unicodedata2 15.0.0
urllib3 1.26.14
wcwidth 0.2.6
webencodings 0.5.1
websocket-client 1.5.0
wheel 0.38.4
widgetsnbextension 4.0.5
xlrd 2.0.1
zict 2.2.0
zipp 3.12.0
zstandard 0.19.0

conda list:
# packages in environment at /opt/conda:
#
# Name Version Build Channel
_libgcc_mutex 0.1 conda_forge conda-forge
_openmp_mutex 4.5 2_kmp_llvm conda-forge
alembic 1.9.1 pyhd8ed1ab_0 conda-forge
altair 4.2.0 pyhd8ed1ab_2 conda-forge
anyio 3.6.2 pyhd8ed1ab_0 conda-forge
aom 3.5.0 h27087fc_0 conda-forge
appdirs 1.4.4 pyh9f0ad1d_0 conda-forge
argon2-cffi 21.3.0 pyhd8ed1ab_0 conda-forge
argon2-cffi-bindings 21.2.0 py310h5764c6d_3 conda-forge
asttokens 2.2.1 pyhd8ed1ab_0 conda-forge
async_generator 1.10 py_0 conda-forge
attrs 22.2.0 pyh71513ae_0 conda-forge
babel 2.11.0 pyhd8ed1ab_0 conda-forge
backcall 0.2.0 pyh9f0ad1d_0 conda-forge
backports 1.0 pyhd8ed1ab_3 conda-forge
backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge
beautifulsoup4 4.11.1 pyha770c72_0 conda-forge
black 23.1.0 pypi_0 pypi
blas 2.116 openblas conda-forge
blas-devel 3.9.0 16_linux64_openblas conda-forge
bleach 6.0.0 pyhd8ed1ab_0 conda-forge
blinker 1.5 pyhd8ed1ab_0 conda-forge
blosc 1.21.3 hafa529b_0 conda-forge
bokeh 2.4.3 pyhd8ed1ab_3 conda-forge
bottleneck 1.3.6 py310h0a54255_0 conda-forge
brotli 1.0.9 h166bdaf_8 conda-forge
brotli-bin 1.0.9 h166bdaf_8 conda-forge
brotlipy 0.7.0 py310h5764c6d_1005 conda-forge
brunsli 0.1 h9c3ff4c_0 conda-forge
bzip2 1.0.8 h7f98852_4 conda-forge
c-ares 1.18.1 h7f98852_0 conda-forge
c-blosc2 2.6.1 hf91038e_0 conda-forge
ca-certificates 2022.12.7 ha878542_0 conda-forge
cached-property 1.5.2 hd8ed1ab_1 conda-forge
cached_property 1.5.2 pyha770c72_1 conda-forge
certifi 2022.12.7 pyhd8ed1ab_0 conda-forge
certipy 0.1.3 py_0 conda-forge
cffi 1.15.1 py310h255011f_3 conda-forge
cfitsio 4.2.0 hd9d235c_0 conda-forge
charls 2.4.1 hcb278e6_0 conda-forge
charset-normalizer 2.1.1 pyhd8ed1ab_0 conda-forge
click 8.1.3 unix_pyhd8ed1ab_2 conda-forge
cloudpickle 2.2.1 pyhd8ed1ab_0 conda-forge
colorama 0.4.6 pyhd8ed1ab_0 conda-forge
comm 0.1.2 pyhd8ed1ab_0 conda-forge
conda 22.11.1 py310hff52083_1 conda-forge
conda-package-handling 2.0.2 pyh38be061_0 conda-forge
conda-package-streaming 0.7.0 pyhd8ed1ab_1 conda-forge
configurable-http-proxy 4.5.3 he2f69ee_3 conda-forge
contourpy 1.0.7 py310hdf3cbec_0 conda-forge
cryptography 39.0.0 py310h34c0648_0 conda-forge
cycler 0.11.0 pyhd8ed1ab_0 conda-forge
cython 0.29.33 py310heca2aa9_0 conda-forge
cytoolz 0.12.0 py310h5764c6d_1 conda-forge
dask 2023.1.1 pyhd8ed1ab_0 conda-forge
dask-core 2023.1.1 pyhd8ed1ab_0 conda-forge
dav1d 1.0.0 h166bdaf_1 conda-forge
debugpy 1.6.6 py310heca2aa9_0 conda-forge
decorator 5.1.1 pyhd8ed1ab_0 conda-forge
defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge
dill 0.3.6 pyhd8ed1ab_1 conda-forge
distributed 2023.1.1 pyhd8ed1ab_0 conda-forge
entrypoints 0.4 pyhd8ed1ab_0 conda-forge
et_xmlfile 1.1.0 pyhd8ed1ab_0 conda-forge
executing 1.2.0 pyhd8ed1ab_0 conda-forge
flit-core 3.8.0 pyhd8ed1ab_0 conda-forge
fmt 9.1.0 h924138e_0 conda-forge
fonttools 4.38.0 py310h5764c6d_1 conda-forge
freetype 2.12.1 hca18f0e_1 conda-forge
fsspec 2023.1.0 pyhd8ed1ab_0 conda-forge
giflib 5.2.1 h36c2ea0_2 conda-forge
gmp 6.2.1 h58526e2_0 conda-forge
gmpy2 2.1.2 py310h3ec546c_1 conda-forge
greenlet 2.0.2 py310heca2aa9_0 conda-forge
h5py 3.8.0 nompi_py310h0311031_100 conda-forge
hdf5 1.12.2 nompi_h4df4325_101 conda-forge
heapdict 1.0.1 py_0 conda-forge
icu 70.1 h27087fc_0 conda-forge
idna 3.4 pyhd8ed1ab_0 conda-forge
imagecodecs 2023.1.23 py310ha3ed6a1_0 conda-forge
imageio 2.25.0 pyh24c5eb1_0 conda-forge
importlib-metadata 6.0.0 pyha770c72_0 conda-forge
importlib_resources 5.10.2 pyhd8ed1ab_0 conda-forge
ipykernel 6.20.2 pyh210e3f2_0 conda-forge
ipympl 0.9.2 pyhd8ed1ab_0 conda-forge
ipython 8.9.0 pyh41d4057_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
ipywidgets 8.0.4 pyhd8ed1ab_0 conda-forge
jedi 0.18.2 pyhd8ed1ab_0 conda-forge
jinja2 3.1.2 pyhd8ed1ab_1 conda-forge
joblib 1.2.0 pyhd8ed1ab_0 conda-forge
jpeg 9e h166bdaf_2 conda-forge
json5 0.9.5 pyh9f0ad1d_0 conda-forge
jsonschema 4.16.0 pyhd8ed1ab_0 conda-forge
jupyter_client 7.4.9 pyhd8ed1ab_0 conda-forge
jupyter_core 5.1.5 py310hff52083_0 conda-forge
jupyter_events 0.6.3 pyhd8ed1ab_0 conda-forge
jupyter_server 2.1.0 pyhd8ed1ab_0 conda-forge
jupyter_server_terminals 0.4.4 pyhd8ed1ab_1 conda-forge
jupyter_telemetry 0.1.0 pyhd8ed1ab_1 conda-forge
jupyterhub 3.1.1 pyh2a2186d_0 conda-forge
jupyterhub-base 3.1.1 pyh2a2186d_0 conda-forge
jupyterlab 3.5.3 pyhd8ed1ab_0 conda-forge
jupyterlab_pygments 0.2.2 pyhd8ed1ab_0 conda-forge
jupyterlab_server 2.16.6 pyhd8ed1ab_0 conda-forge
jupyterlab_widgets 3.0.5 pyhd8ed1ab_0 conda-forge
jxrlib 1.1 h7f98852_2 conda-forge
keyutils 1.6.1 h166bdaf_0 conda-forge
kiwisolver 1.4.4 py310hbf28c38_1 conda-forge
krb5 1.20.1 h81ceb04_0 conda-forge
lcms2 2.14 hfd0df8a_1 conda-forge
ld_impl_linux-64 2.40 h41732ed_0 conda-forge
lerc 4.0.0 h27087fc_0 conda-forge
libaec 1.0.6 hcb278e6_1 conda-forge
libarchive 3.6.2 h3d51595_0 conda-forge
libavif 0.11.1 h5cdd6b5_0 conda-forge
libblas 3.9.0 16_linux64_openblas conda-forge
libbrotlicommon 1.0.9 h166bdaf_8 conda-forge
libbrotlidec 1.0.9 h166bdaf_8 conda-forge
libbrotlienc 1.0.9 h166bdaf_8 conda-forge
libcblas 3.9.0 16_linux64_openblas conda-forge
libcurl 7.87.0 hdc1c0ab_0 conda-forge
libdeflate 1.17 h0b41bf4_0 conda-forge
libedit 3.1.20191231 he28a2e2_2 conda-forge
libev 4.33 h516909a_1 conda-forge
libffi 3.4.2 h7f98852_5 conda-forge
libgcc-ng 12.2.0 h65d4601_19 conda-forge
libgfortran-ng 12.2.0 h69a702a_19 conda-forge
libgfortran5 12.2.0 h337968e_19 conda-forge
libgomp 12.2.0 h65d4601_19 conda-forge
libiconv 1.17 h166bdaf_0 conda-forge
libjpeg-turbo 2.1.4 h166bdaf_0 conda-forge
liblapack 3.9.0 16_linux64_openblas conda-forge
liblapacke 3.9.0 16_linux64_openblas conda-forge
libllvm11 11.1.0 he0ac6c6_5 conda-forge
libmamba 1.2.0 hcea66bb_0 conda-forge
libmambapy 1.2.0 py310h1428755_0 conda-forge
libnghttp2 1.51.0 hff17c54_0 conda-forge
libnsl 2.0.0 h7f98852_0 conda-forge
libopenblas 0.3.21 pthreads_h78a6416_3 conda-forge
libpng 1.6.39 h753d276_0 conda-forge
libprotobuf 3.21.12 h3eb15da_0 conda-forge
libsodium 1.0.18 h36c2ea0_1 conda-forge
libsolv 0.7.23 h3eb15da_0 conda-forge
libsqlite 3.40.0 h753d276_0 conda-forge
libssh2 1.10.0 hf14f497_3 conda-forge
libstdcxx-ng 12.2.0 h46fd767_19 conda-forge
libtiff 4.5.0 h6adf6a1_2 conda-forge
libuuid 2.32.1 h7f98852_1000 conda-forge
libuv 1.44.2 h166bdaf_0 conda-forge
libwebp-base 1.2.4 h166bdaf_0 conda-forge
libxcb 1.13 h7f98852_1004 conda-forge
libxml2 2.10.3 h7463322_0 conda-forge
libzlib 1.2.13 h166bdaf_4 conda-forge
libzopfli 1.0.3 h9c3ff4c_0 conda-forge
llvm-openmp 15.0.7 h0cdce71_0 conda-forge
llvmlite 0.39.1 py310h58363a5_1 conda-forge
locket 1.0.0 pyhd8ed1ab_0 conda-forge
lz4 4.2.0 py310h0cfdcf0_0 conda-forge
lz4-c 1.9.4 hcb278e6_0 conda-forge
lzo 2.10 h516909a_1000 conda-forge
mako 1.2.4 pyhd8ed1ab_0 conda-forge
mamba 1.2.0 py310h51d5547_0 conda-forge
markupsafe 2.1.2 py310h1fa729e_0 conda-forge
matplotlib-base 3.6.3 py310he60537e_0 conda-forge
matplotlib-inline 0.1.6 pyhd8ed1ab_0 conda-forge
mistune 2.0.4 pyhd8ed1ab_0 conda-forge
mpc 1.3.1 hfe3b2da_0 conda-forge
mpfr 4.1.0 h9202a9a_1 conda-forge
mpmath 1.2.1 pyhd8ed1ab_0 conda-forge
msgpack-python 1.0.4 py310hbf28c38_1 conda-forge
munkres 1.1.4 pyh9f0ad1d_0 conda-forge
mypy-extensions 1.0.0 pypi_0 pypi
nb-black 1.0.7 pypi_0 pypi
nbclassic 0.4.8 pyhd8ed1ab_0 conda-forge
nbclient 0.7.2 pyhd8ed1ab_0 conda-forge
nbconvert 7.2.9 pyhd8ed1ab_0 conda-forge
nbconvert-core 7.2.9 pyhd8ed1ab_0 conda-forge
nbconvert-pandoc 7.2.9 pyhd8ed1ab_0 conda-forge
nbformat 5.7.3 pyhd8ed1ab_0 conda-forge
ncurses 6.3 h27087fc_1 conda-forge
nest-asyncio 1.5.6 pyhd8ed1ab_0 conda-forge
networkx 3.0 pyhd8ed1ab_0 conda-forge
nodejs 18.12.1 h8839609_0 conda-forge
nomkl 1.0 h5ca1d4c_0 conda-forge
notebook 6.5.2 pyha770c72_1 conda-forge
notebook-shim 0.2.2 pyhd8ed1ab_0 conda-forge
numba 0.56.4 py310ha5257ce_0 conda-forge
numexpr 2.8.3 py310hf05e7a9_101 conda-forge
numpy 1.23.5 py310h53a5b5f_0 conda-forge
oauthlib 3.2.2 pyhd8ed1ab_0 conda-forge
openblas 0.3.21 pthreads_h320a7e8_3 conda-forge
openjpeg 2.5.0 hfec8fc6_2 conda-forge
openpyxl 3.0.10 py310h5764c6d_2 conda-forge
openssl 3.0.7 h0b41bf4_2 conda-forge
packaging 23.0 pyhd8ed1ab_0 conda-forge
pamela 1.0.0 py_0 conda-forge
pandas 1.5.3 py310h9b08913_0 conda-forge
pandoc 2.19.2 h32600fe_1 conda-forge
pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge
parso 0.8.3 pyhd8ed1ab_0 conda-forge
partd 1.3.0 pyhd8ed1ab_0 conda-forge
pathspec 0.11.0 pypi_0 pypi
patsy 0.5.3 pyhd8ed1ab_0 conda-forge
pexpect 4.8.0 pyh1a96a4e_2 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pillow 9.4.0 py310h4927cde_0 conda-forge
pip 22.3.1 pyhd8ed1ab_0 conda-forge
pkgutil-resolve-name 1.3.10 pyhd8ed1ab_0 conda-forge
platformdirs 2.6.2 pyhd8ed1ab_0 conda-forge
pluggy 1.0.0 pyhd8ed1ab_5 conda-forge
pooch 1.6.0 pyhd8ed1ab_0 conda-forge
prometheus_client 0.16.0 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.36 pyha770c72_0 conda-forge
protobuf 4.21.12 py310heca2aa9_0 conda-forge
psutil 5.9.4 py310h5764c6d_0 conda-forge
pthread-stubs 0.4 h36c2ea0_1001 conda-forge
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge
pybind11-abi 4 hd8ed1ab_3 conda-forge
pycosat 0.6.4 py310h5764c6d_1 conda-forge
pycparser 2.21 pyhd8ed1ab_0 conda-forge
pycurl 7.45.1 py310h60f9ec7_3 conda-forge
pygments 2.14.0 pyhd8ed1ab_0 conda-forge
pyjwt 2.6.0 pyhd8ed1ab_0 conda-forge
pyopenssl 23.0.0 pyhd8ed1ab_0 conda-forge
pyparsing 3.0.9 pyhd8ed1ab_0 conda-forge
pyrsistent 0.19.3 py310h1fa729e_0 conda-forge
pysocks 1.7.1 pyha2e5f31_6 conda-forge
pytables 3.7.0 py310hb60b9b2_3 conda-forge
python 3.10.8 h4a9ceb5_0_cpython conda-forge
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge
python-fastjsonschema 2.16.2 pyhd8ed1ab_0 conda-forge
python-json-logger 2.0.4 pyhd8ed1ab_0 conda-forge
python_abi 3.10 3_cp310 conda-forge
pytz 2022.7.1 pyhd8ed1ab_0 conda-forge
pywavelets 1.4.1 py310h0a54255_0 conda-forge
pyyaml 6.0 py310h5764c6d_5 conda-forge
pyzmq 25.0.0 py310h059b190_0 conda-forge
readline 8.1.2 h0f457ee_0 conda-forge
reproc 14.2.4 h0b41bf4_0 conda-forge
reproc-cpp 14.2.4 hcb278e6_0 conda-forge
requests 2.28.2 pyhd8ed1ab_0 conda-forge
rfc3339-validator 0.1.4 pyhd8ed1ab_0 conda-forge
rfc3986-validator 0.1.1 pyh9f0ad1d_0 conda-forge
ruamel.yaml 0.17.21 py310h5764c6d_2 conda-forge
ruamel.yaml.clib 0.2.7 py310h1fa729e_1 conda-forge
scikit-image 0.19.3 py310h769672d_2 conda-forge
scikit-learn 1.2.1 py310h209a8ca_0 conda-forge
scipy 1.10.0 py310h8deb116_0 conda-forge
seaborn 0.12.2 hd8ed1ab_0 conda-forge
seaborn-base 0.12.2 pyhd8ed1ab_0 conda-forge
send2trash 1.8.0 pyhd8ed1ab_0 conda-forge
setuptools 66.1.1 pyhd8ed1ab_0 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
snappy 1.1.9 hbd366e4_2 conda-forge
sniffio 1.3.0 pyhd8ed1ab_0 conda-forge
sortedcontainers 2.4.0 pyhd8ed1ab_0 conda-forge
soupsieve 2.3.2.post1 pyhd8ed1ab_0 conda-forge
sqlalchemy 2.0.0 py310h1fa729e_0 conda-forge
stack_data 0.6.2 pyhd8ed1ab_0 conda-forge
statsmodels 0.13.5 py310hde88566_2 conda-forge
sympy 1.11.1 py310hff52083_2 conda-forge
tblib 1.7.0 pyhd8ed1ab_0 conda-forge
terminado 0.17.1 pyh41d4057_0 conda-forge
threadpoolctl 3.1.0 pyh8a188c0_0 conda-forge
tifffile 2023.1.23.1 pyhd8ed1ab_0 conda-forge
tinycss2 1.2.1 pyhd8ed1ab_0 conda-forge
tk 8.6.12 h27826a3_0 conda-forge
tomli 2.0.1 pyhd8ed1ab_0 conda-forge
toolz 0.12.0 pyhd8ed1ab_0 conda-forge
tornado 6.2 py310h5764c6d_1 conda-forge
tqdm 4.64.1 pyhd8ed1ab_0 conda-forge
traitlets 5.8.1 pyhd8ed1ab_0 conda-forge
typing-extensions 4.4.0 hd8ed1ab_0 conda-forge
typing_extensions 4.4.0 pyha770c72_0 conda-forge
tzdata 2022g h191b570_0 conda-forge
unicodedata2 15.0.0 py310h5764c6d_0 conda-forge
urllib3 1.26.14 pyhd8ed1ab_0 conda-forge
wcwidth 0.2.6 pyhd8ed1ab_0 conda-forge
webencodings 0.5.1 py_1 conda-forge
websocket-client 1.5.0 pyhd8ed1ab_0 conda-forge
wheel 0.38.4 pyhd8ed1ab_0 conda-forge
widgetsnbextension 4.0.5 pyhd8ed1ab_0 conda-forge
xlrd 2.0.1 pyhd8ed1ab_3 conda-forge
xorg-libxau 1.0.9 h7f98852_0 conda-forge
xorg-libxdmcp 1.1.3 h7f98852_0 conda-forge
xz 5.2.6 h166bdaf_0 conda-forge
yaml 0.2.5 h7f98852_2 conda-forge
yaml-cpp 0.7.0 h27087fc_2 conda-forge
zeromq 4.3.4 h9c3ff4c_1 conda-forge
zfp 1.0.0 h27087fc_3 conda-forge
zict 2.2.0 pyhd8ed1ab_0 conda-forge
zipp 3.12.0 pyhd8ed1ab_0 conda-forge
zlib 1.2.13 h166bdaf_4 conda-forge
zlib-ng 2.0.6 h166bdaf_0 conda-forge
zstandard 0.19.0 py310hdeb6495_1 conda-forge
zstd 1.5.2 h3eb15da_6 conda-forge

@paoloalba
Copy link
Author

paoloalba commented Mar 30, 2023

@paoloalba What are you seeing and what are you expecting, specifically? Can you tell us the styles that you're expecting to see and what's actually getting applied? I'm not sure whether this is a bug in JupyterLab.

I would expect the background of the output cell to turn in color. Pygments is correctly assigning the property to the background, at least as I would expect. My assumption is that the output-cell is a mixture of several classes and attributes, that eventually overwrite the possibility of assigning any background to my <pre> element.

At this point the problem is totally unrelated from the specific package employed (pygments), since I tried to patch manually the styles of several html elements myself (debugging through the dev-tools of the browser). The question that you should be able to answer to help me, is simply to which element do I need to assign the background-color, in order to have an uniform dark background in my output cell (and only a specific single output cell, I am not talking about a global property of a theme)

@paoloalba
Copy link
Author

@JasonWeill here the given html string with the styles:
<style type="text/css">pre { line-height: 125%; } td.linenos .normal { color: #6e7681; background-color: #0d1117; padding-left: 5px; padding-right: 5px; } span.linenos { color: #6e7681; background-color: #0d1117; padding-left: 5px; padding-right: 5px; } td.linenos .special { color: #c9d1d9; background-color: #6e7681; padding-left: 5px; padding-right: 5px; } span.linenos.special { color: #c9d1d9; background-color: #6e7681; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #6e7681 } .highlight { background: #0d1117; color: #c9d1d9 } .highlight .c { color: #8b949e; font-style: italic } /* Comment */ .highlight .err { color: #f85149 } /* Error */ .highlight .esc { color: #c9d1d9 } /* Escape */ .highlight .g { color: #c9d1d9 } /* Generic */ .highlight .k { color: #ff7b72 } /* Keyword */ .highlight .l { color: #a5d6ff } /* Literal */ .highlight .n { color: #c9d1d9 } /* Name */ .highlight .o { color: #ff7b72; font-weight: bold } /* Operator */ .highlight .x { color: #c9d1d9 } /* Other */ .highlight .p { color: #c9d1d9 } /* Punctuation */ .highlight .ch { color: #8b949e; font-style: italic } /* Comment.Hashbang */ .highlight .cm { color: #8b949e; font-style: italic } /* Comment.Multiline */ .highlight .cp { color: #8b949e; font-weight: bold; font-style: italic } /* Comment.Preproc */ .highlight .cpf { color: #8b949e; font-style: italic } /* Comment.PreprocFile */ .highlight .c1 { color: #8b949e; font-style: italic } /* Comment.Single */ .highlight .cs { color: #8b949e; font-weight: bold; font-style: italic } /* Comment.Special */ .highlight .gd { color: #ffa198; background-color: #490202 } /* Generic.Deleted */ .highlight .ge { color: #c9d1d9; font-style: italic } /* Generic.Emph */ .highlight .gr { color: #ffa198 } /* Generic.Error */ .highlight .gh { color: #79c0ff; font-weight: bold } /* Generic.Heading */ .highlight .gi { color: #56d364; background-color: #0f5323 } /* Generic.Inserted */ .highlight .go { color: #8b949e } /* Generic.Output */ .highlight .gp { color: #8b949e } /* Generic.Prompt */ .highlight .gs { color: #c9d1d9; font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #79c0ff } /* Generic.Subheading */ .highlight .gt { color: #ff7b72 } /* Generic.Traceback */ .highlight .g-Underline { color: #c9d1d9; text-decoration: underline } /* Generic.Underline */ .highlight .kc { color: #79c0ff } /* Keyword.Constant */ .highlight .kd { color: #ff7b72 } /* Keyword.Declaration */ .highlight .kn { color: #ff7b72 } /* Keyword.Namespace */ .highlight .kp { color: #79c0ff } /* Keyword.Pseudo */ .highlight .kr { color: #ff7b72 } /* Keyword.Reserved */ .highlight .kt { color: #ff7b72 } /* Keyword.Type */ .highlight .ld { color: #79c0ff } /* Literal.Date */ .highlight .m { color: #a5d6ff } /* Literal.Number */ .highlight .s { color: #a5d6ff } /* Literal.String */ .highlight .na { color: #c9d1d9 } /* Name.Attribute */ .highlight .nb { color: #c9d1d9 } /* Name.Builtin */ .highlight .nc { color: #f0883e; font-weight: bold } /* Name.Class */ .highlight .no { color: #79c0ff; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #d2a8ff; font-weight: bold } /* Name.Decorator */ .highlight .ni { color: #ffa657 } /* Name.Entity */ .highlight .ne { color: #f0883e; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #d2a8ff; font-weight: bold } /* Name.Function */ .highlight .nl { color: #79c0ff; font-weight: bold } /* Name.Label */ .highlight .nn { color: #ff7b72 } /* Name.Namespace */ .highlight .nx { color: #c9d1d9 } /* Name.Other */ .highlight .py { color: #79c0ff } /* Name.Property */ .highlight .nt { color: #7ee787 } /* Name.Tag */ .highlight .nv { color: #79c0ff } /* Name.Variable */ .highlight .ow { color: #ff7b72; font-weight: bold } /* Operator.Word */ .highlight .pm { color: #c9d1d9 } /* Punctuation.Marker */ .highlight .w { color: #6e7681 } /* Text.Whitespace */ .highlight .mb { color: #a5d6ff } /* Literal.Number.Bin */ .highlight .mf { color: #a5d6ff } /* Literal.Number.Float */ .highlight .mh { color: #a5d6ff } /* Literal.Number.Hex */ .highlight .mi { color: #a5d6ff } /* Literal.Number.Integer */ .highlight .mo { color: #a5d6ff } /* Literal.Number.Oct */ .highlight .sa { color: #79c0ff } /* Literal.String.Affix */ .highlight .sb { color: #a5d6ff } /* Literal.String.Backtick */ .highlight .sc { color: #a5d6ff } /* Literal.String.Char */ .highlight .dl { color: #79c0ff } /* Literal.String.Delimiter */ .highlight .sd { color: #a5d6ff } /* Literal.String.Doc */ .highlight .s2 { color: #a5d6ff } /* Literal.String.Double */ .highlight .se { color: #79c0ff } /* Literal.String.Escape */ .highlight .sh { color: #79c0ff } /* Literal.String.Heredoc */ .highlight .si { color: #a5d6ff } /* Literal.String.Interpol */ .highlight .sx { color: #a5d6ff } /* Literal.String.Other */ .highlight .sr { color: #79c0ff } /* Literal.String.Regex */ .highlight .s1 { color: #a5d6ff } /* Literal.String.Single */ .highlight .ss { color: #a5d6ff } /* Literal.String.Symbol */ .highlight .bp { color: #c9d1d9 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #d2a8ff; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #79c0ff } /* Name.Variable.Class */ .highlight .vg { color: #79c0ff } /* Name.Variable.Global */ .highlight .vi { color: #79c0ff } /* Name.Variable.Instance */ .highlight .vm { color: #79c0ff } /* Name.Variable.Magic */ .highlight .il { color: #a5d6ff } /* Literal.Number.Integer.Long */</style> <div class="highlight"><pre><span></span><span class="k">SELECT</span> <span class="w"> </span><span class="o">*</span> <span class="k">FROM</span> <span class="w"> </span><span class="n">latest</span><span class="p">.</span><span class="n">tmp</span> </pre></div>

@paoloalba
Copy link
Author

@JasonWeill the .highlight { background: #0d1117; color: #c9d1d9 } line in the style, should be, according to my limited experience, enough to give a background to the <div class="highlight"> element.
I tried to add to the given style a bunch of background/background-color to some elements (jp-outputcell, jp-outputcell-are, etc.), but none of them seems to be effective

@paoloalba
Copy link
Author

manually patching the <span> element with the highlight class, has a limited effect for each line.
Senza nome

I tried to do something similar with the <pre> element but no luck from my side.

@JasonWeill JasonWeill removed status:Needs Info status:Needs Triage Applied to new issues that need triage labels Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement tag:CSS For general CSS related issues and pecadilloes
Projects
None yet
Development

No branches or pull requests

3 participants