All Projects → wallneradam → jupyterlab-custom-css

wallneradam / jupyterlab-custom-css

Licence: other
Add custom CSS rules for JupyterLab

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to jupyterlab-custom-css

Jupyterlab templates
Support for jupyter notebook templates in jupyterlab
Stars: ✭ 223 (+596.88%)
Mutual labels:  notebook, jupyterlab, jupyterlab-extension
Best Of Jupyter
🏆 A ranked list of awesome Jupyter Notebook, Hub and Lab projects (extensions, kernels, tools). Updated weekly.
Stars: ✭ 200 (+525%)
Mutual labels:  notebook, jupyterlab, jupyterlab-extension
Awesome Jupyterlab Extension
😎 A curated list of awesome Jupyterlab extension projects. 🌠 Detailed introduction with images.
Stars: ✭ 198 (+518.75%)
Mutual labels:  notebook, jupyterlab, jupyterlab-extension
Jupyterlab Lsp
Coding assistance for JupyterLab (code navigation + hover suggestions + linters + autocompletion + rename) using Language Server Protocol
Stars: ✭ 796 (+2387.5%)
Mutual labels:  notebook, jupyterlab, jupyterlab-extension
Polyaxon
Machine Learning Platform for Kubernetes (MLOps tools for experimentation and automation)
Stars: ✭ 2,966 (+9168.75%)
Mutual labels:  notebook, jupyterlab
theme-cookiecutter
A cookiecutter template to help you make new JupyterLab theme extensions
Stars: ✭ 47 (+46.88%)
Mutual labels:  jupyterlab, jupyterlab-extension
jupyterlab iframe
View html as an embedded iframe in JupyterLab
Stars: ✭ 91 (+184.38%)
Mutual labels:  jupyterlab, jupyterlab-extension
Jupyterlab voyager
JupyterLab extension visualize data with Voyager
Stars: ✭ 244 (+662.5%)
Mutual labels:  jupyterlab, jupyterlab-extension
Jupyterlab Interactive Dashboard Editor
A drag-and-drop dashboard editor for JupyterLab
Stars: ✭ 165 (+415.63%)
Mutual labels:  notebook, jupyterlab
hub
Public reusable components for Polyaxon
Stars: ✭ 8 (-75%)
Mutual labels:  notebook, jupyterlab
jupyterlab-kubeflow-kale
JupyterLab extension to provide a Kubeflow specific left area for Notebooks deployment
Stars: ✭ 17 (-46.87%)
Mutual labels:  jupyterlab, jupyterlab-extension
knowledgelab
KnowledgeRepo + JupyterLab
Stars: ✭ 46 (+43.75%)
Mutual labels:  jupyterlab, jupyterlab-extension
docker-stacks
Ready-to-run Docker images containing Jupyter applications
Stars: ✭ 6,573 (+20440.63%)
Mutual labels:  notebook, jupyterlab
jupyterlab plotly
This repository is deprecated. The extension has moved to https://github.com/jupyterlab/jupyter-renderers
Stars: ✭ 16 (-50%)
Mutual labels:  notebook, jupyterlab
Jupyterlab tensorboard
Tensorboard extension for jupyterlab.
Stars: ✭ 245 (+665.63%)
Mutual labels:  jupyterlab, jupyterlab-extension
jupyterlab-link-share
JupyterLab Extension to easily share a link to a running server on Binder
Stars: ✭ 40 (+25%)
Mutual labels:  jupyterlab, jupyterlab-extension
Jupyterlab Hub
Deprecated: JupyterLab extension for running JupyterLab with JupyterHub
Stars: ✭ 181 (+465.63%)
Mutual labels:  jupyterlab, jupyterlab-extension
Awesome Jupyter
A curated list of awesome Jupyter projects, libraries and resources
Stars: ✭ 2,523 (+7784.38%)
Mutual labels:  jupyterlab, jupyterlab-extension
Paperboy
A web frontend for scheduling Jupyter notebook reports
Stars: ✭ 221 (+590.63%)
Mutual labels:  notebook, jupyterlab
jupyterlab-vimrc
add a basic vimrc to jupyterlab vim
Stars: ✭ 59 (+84.38%)
Mutual labels:  jupyterlab, jupyterlab-extension

custom-css

Add custom CSS rules to JupyterLab

Usage

After install the plugin, you should see an item called "Custom CSS" in the settings in "Advanced Settings Editor". Here you can specify any CSS rules you want.

{
    "rules": [
        {
            "selector": ".cls-parent .cls-child",
            "styles": [
                "max-height: 100px",
                "font-size: 14px"
            ]
        },
        ...
    ]
}

This will create an inline <style> element in the document's body.

When you save changes it will immediately be active, so you don't need to restart JupyterLab.

Useful JupyterLab CSS tricks with custom-css

Enlarge output height when scrolling is enabled

{
    "rules": [
        {
            "selector": ".jp-CodeCell.jp-mod-outputsScrolled .jp-Cell-outputArea",
            "styles": [
                "max-height: 300px"  // Original is 200px
            ]
        }
    ]
}

Decrease output font size and make the same font for rendered HTML

{
    "rules": [
        {
            "selector": ".jp-OutputArea-output.jp-RenderedText pre, .jp-OutputArea-output.jp-RenderedHTMLCommon",
            "styles": [
                "font-family: var(--jp-code-font-family)", // Make font the same as code font
                "font-size: 90%"  // Make font smaller
            ]
        },

        // Make tables the same font size as the other outputs
        {
            "selector": ".jp-RenderedHTMLCommon table",
            "styles": [
                "font-size: inherit !important" // Make use the same size
            ]
        },
    ]
}

Reorder sidebar icons

You can even reorder sidebar icons and tabs by CSS:

{
    "rules": [
        // Set order to 50 for default
        {
            "selector": ".p-TabBar-tab",
            "styles": [
                "order: 50"
            ]
        },
        // File browser always the 1st
        {
            "selector": ".p-TabBar-tab[data-id='filebrowser']",
            "styles": [
                "order: 1"
            ]
        },
        // Below 50 will be at the top
        {
            "selector": ".p-TabBar-tab[data-id='extensionmanager.main-view']",
            "styles": [
                "order: 2"
            ]
        },
        // Over 50 will be at the bottom
        {
            "selector": ".p-TabBar-tab[data-id='command-palette']",
            "styles": [
                "order: 51"
            ]
        }
    ]
}

Same technic could be good for menu entries and toolbar buttons (not tested).

Grayscale icon if the extension has color icon (which is awful, because every other icons are monochrome)

{
    "rules": [
        // HDF5 toolbar icon
        {
            "selector": ".jp-HdfIcon",
            "styles": [
                "filter: grayscale(1) brightness(3.5)"
            ]
        },
    ]
}

Prerequisites

  • JupyterLab
  • Some CSS knowledge

Installation

jupyter labextension install @wallneradam/custom_css

Development

For a development install (requires npm version 4 or later), do the following in the repository directory:

npm install
npm run build
jupyter labextension link .

To rebuild the package and the JupyterLab app:

npm run build
jupyter lab build
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].