├── .eslintignore ├── .eslintrc.js ├── .github └── workflows │ └── build.yml ├── .gitignore ├── .prettierignore ├── .prettierrc ├── LICENSE ├── MANIFEST.in ├── README.md ├── binder ├── environment.yml └── postBuild ├── install.json ├── jupyterlab_iolab_theme ├── __init__.py └── _version.py ├── package.json ├── pyproject.toml ├── setup.py ├── src └── index.ts ├── style ├── index.css └── variables.css └── tsconfig.json /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | coverage 4 | **/*.d.ts 5 | tests 6 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: [ 3 | 'eslint:recommended', 4 | 'plugin:@typescript-eslint/eslint-recommended', 5 | 'plugin:@typescript-eslint/recommended', 6 | 'plugin:prettier/recommended' 7 | ], 8 | parser: '@typescript-eslint/parser', 9 | parserOptions: { 10 | project: 'tsconfig.json', 11 | sourceType: 'module' 12 | }, 13 | plugins: ['@typescript-eslint'], 14 | rules: { 15 | '@typescript-eslint/interface-name-prefix': [ 16 | 'error', 17 | { prefixWithI: 'always' } 18 | ], 19 | '@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }], 20 | '@typescript-eslint/no-explicit-any': 'off', 21 | '@typescript-eslint/no-namespace': 'off', 22 | '@typescript-eslint/no-use-before-define': 'off', 23 | '@typescript-eslint/quotes': [ 24 | 'error', 25 | 'single', 26 | { avoidEscape: true, allowTemplateLiterals: false } 27 | ], 28 | curly: ['error', 'all'], 29 | eqeqeq: 'error', 30 | 'prefer-arrow-callback': 'error' 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches: master 6 | pull_request: 7 | branches: '*' 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v2 15 | - name: Install node 16 | uses: actions/setup-node@v1 17 | with: 18 | node-version: '12.x' 19 | - name: Install Python 20 | uses: actions/setup-python@v2 21 | with: 22 | python-version: '3.7' 23 | architecture: 'x64' 24 | - name: Install dependencies 25 | run: python -m pip install jupyterlab==3 jupyter_packaging 26 | - name: Build the extension 27 | run: | 28 | jlpm 29 | jlpm run eslint:check 30 | python -m pip install . 31 | jupyter labextension list 2>&1 | grep -ie "@aimarket/jupyterlab-iolab-theme.*OK" 32 | python -m jupyterlab.browser_check 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.bundle.* 2 | lib/ 3 | node_modules/ 4 | *.egg-info/ 5 | .ipynb_checkpoints 6 | *.tsbuildinfo 7 | jupyterlab_iolab_theme/labextension 8 | 9 | # Created by https://www.gitignore.io/api/python 10 | # Edit at https://www.gitignore.io/?templates=python 11 | 12 | ### Python ### 13 | # Byte-compiled / optimized / DLL files 14 | __pycache__/ 15 | *.py[cod] 16 | *$py.class 17 | 18 | # C extensions 19 | *.so 20 | 21 | # Distribution / packaging 22 | .Python 23 | build/ 24 | develop-eggs/ 25 | dist/ 26 | downloads/ 27 | eggs/ 28 | .eggs/ 29 | lib/ 30 | lib64/ 31 | parts/ 32 | sdist/ 33 | var/ 34 | wheels/ 35 | pip-wheel-metadata/ 36 | share/python-wheels/ 37 | .installed.cfg 38 | *.egg 39 | MANIFEST 40 | 41 | # PyInstaller 42 | # Usually these files are written by a python script from a template 43 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 44 | *.manifest 45 | *.spec 46 | 47 | # Installer logs 48 | pip-log.txt 49 | pip-delete-this-directory.txt 50 | 51 | # Unit test / coverage reports 52 | htmlcov/ 53 | .tox/ 54 | .nox/ 55 | .coverage 56 | .coverage.* 57 | .cache 58 | nosetests.xml 59 | coverage.xml 60 | *.cover 61 | .hypothesis/ 62 | .pytest_cache/ 63 | 64 | # Translations 65 | *.mo 66 | *.pot 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # pyenv 78 | .python-version 79 | 80 | # celery beat schedule file 81 | celerybeat-schedule 82 | 83 | # SageMath parsed files 84 | *.sage.py 85 | 86 | # Spyder project settings 87 | .spyderproject 88 | .spyproject 89 | 90 | # Rope project settings 91 | .ropeproject 92 | 93 | # Mr Developer 94 | .mr.developer.cfg 95 | .project 96 | .pydevproject 97 | 98 | # mkdocs documentation 99 | /site 100 | 101 | # mypy 102 | .mypy_cache/ 103 | .dmypy.json 104 | dmypy.json 105 | 106 | # Pyre type checker 107 | .pyre/ 108 | 109 | # End of https://www.gitignore.io/api/python 110 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | **/node_modules 3 | **/lib 4 | **/package.json 5 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2020, Railson Sousa All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | * Neither the name of the copyright holder nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE 2 | include README.md 3 | include pyproject.toml 4 | include jupyter-config/jupyterlab_iolab_theme.json 5 | 6 | include package.json 7 | include install.json 8 | include ts*.json 9 | 10 | graft jupyterlab_iolab_theme/labextension 11 | 12 | # Javascript files 13 | graft src 14 | graft style 15 | prune **/node_modules 16 | prune lib 17 | 18 | # Patterns to exclude from any directory 19 | global-exclude *~ 20 | global-exclude *.pyc 21 | global-exclude *.pyo 22 | global-exclude .git 23 | global-exclude .ipynb_checkpoints 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # jupyterlab_iolab_theme 2 | 3 | ![Github Actions Status](https://github.com/railsonsousa106/jupyterlab-iolab-theme/workflows/Build/badge.svg) 4 | 5 | IO Lab's JupyterLab Theme 6 | 7 | 8 | ## Requirements 9 | 10 | * JupyterLab >= 3.0 11 | 12 | ## Install 13 | 14 | ```bash 15 | pip install jupyterlab_iolab_theme 16 | ``` 17 | 18 | ## Contributing 19 | 20 | ### Development install 21 | 22 | Note: You will need NodeJS to build the extension package. 23 | 24 | The `jlpm` command is JupyterLab's pinned version of 25 | [yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use 26 | `yarn` or `npm` in lieu of `jlpm` below. 27 | 28 | ```bash 29 | # Clone the repo to your local environment 30 | # Change directory to the jupyterlab_iolab_theme directory 31 | # Install package in development mode 32 | pip install -e . 33 | # Link your development version of the extension with JupyterLab 34 | jupyter labextension develop . --overwrite 35 | # Rebuild extension Typescript source after making changes 36 | jlpm run build 37 | ``` 38 | 39 | You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension. 40 | 41 | ```bash 42 | # Watch the source directory in one terminal, automatically rebuilding when needed 43 | jlpm run watch 44 | # Run JupyterLab in another terminal 45 | jupyter lab 46 | ``` 47 | 48 | With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt). 49 | 50 | By default, the `jlpm run build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command: 51 | 52 | ```bash 53 | jupyter lab build --minimize=False 54 | ``` 55 | 56 | ### Uninstall 57 | 58 | ```bash 59 | pip uninstall jupyterlab_iolab_theme 60 | jupyter labextension uninstall @aimarket/jupyterlab-iolab-theme 61 | ``` 62 | -------------------------------------------------------------------------------- /binder/environment.yml: -------------------------------------------------------------------------------- 1 | # a mybinder.org-ready environment for demoing jupyterlab_iolab_theme 2 | # this environment may also be used locally on Linux/MacOS/Windows, e.g. 3 | # 4 | # conda env update --file binder/environment.yml 5 | # conda activate jupyterlab_iolab_theme-demo 6 | # 7 | name: jupyterlab_iolab_theme-demo 8 | 9 | channels: 10 | - conda-forge 11 | 12 | dependencies: 13 | # runtime dependencies 14 | - python >=3.8,<3.9.0a0 15 | - jupyterlab >=3,<4.0.0a0 16 | # labextension build dependencies 17 | - nodejs >=14,<15 18 | - pip 19 | - wheel 20 | # additional packages for demos 21 | # - ipywidgets 22 | -------------------------------------------------------------------------------- /binder/postBuild: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ perform a development install of jupyterlab_iolab_theme 3 | 4 | On Binder, this will run _after_ the environment has been fully created from 5 | the environment.yml in this directory. 6 | 7 | This script should also run locally on Linux/MacOS/Windows: 8 | 9 | python3 binder/postBuild 10 | """ 11 | import subprocess 12 | import sys 13 | from pathlib import Path 14 | 15 | 16 | ROOT = Path.cwd() 17 | 18 | def _(*args, **kwargs): 19 | """ Run a command, echoing the args 20 | 21 | fails hard if something goes wrong 22 | """ 23 | print("\n\t", " ".join(args), "\n") 24 | return_code = subprocess.call(args, **kwargs) 25 | if return_code != 0: 26 | print("\nERROR", return_code, " ".join(args)) 27 | sys.exit(return_code) 28 | 29 | # verify the environment is self-consistent before even starting 30 | _(sys.executable, "-m", "pip", "check") 31 | 32 | # install the labextension 33 | _(sys.executable, "-m", "pip", "install", "-e", ".") 34 | 35 | # verify the environment the extension didn't break anything 36 | _(sys.executable, "-m", "pip", "check") 37 | 38 | # list the extensions 39 | _("jupyter", "server", "extension", "list") 40 | 41 | # initially list installed extensions to determine if there are any surprises 42 | _("jupyter", "labextension", "list") 43 | 44 | 45 | print("JupyterLab with jupyterlab_iolab_theme is ready to run with:\n") 46 | print("\tjupyter lab\n") 47 | -------------------------------------------------------------------------------- /install.json: -------------------------------------------------------------------------------- 1 | { 2 | "packageManager": "python", 3 | "packageName": "jupyterlab_iolab_theme", 4 | "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_iolab_theme" 5 | } 6 | -------------------------------------------------------------------------------- /jupyterlab_iolab_theme/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | import json 3 | import os.path as osp 4 | 5 | from ._version import __version__ 6 | 7 | HERE = osp.abspath(osp.dirname(__file__)) 8 | 9 | with open(osp.join(HERE, 'labextension', 'package.json')) as fid: 10 | data = json.load(fid) 11 | 12 | 13 | def _jupyter_labextension_paths(): 14 | return [{ 15 | 'src': 'labextension', 16 | 'dest': data['name'] 17 | }] 18 | -------------------------------------------------------------------------------- /jupyterlab_iolab_theme/_version.py: -------------------------------------------------------------------------------- 1 | __all__ = ['__version__'] 2 | 3 | 4 | def _fetchVersion(): 5 | import json 6 | import os 7 | 8 | here = os.path.abspath(os.path.dirname(__file__)) 9 | 10 | for d, _, _ in os.walk(here): 11 | try: 12 | with open(os.path.join(d, 'package.json')) as f: 13 | return json.load(f)['version'] 14 | except FileNotFoundError: 15 | pass 16 | 17 | raise FileNotFoundError('Could not find package.json under dir {}'.format(here)) 18 | 19 | __version__ = _fetchVersion() 20 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@aimarket/jupyterlab-iolab-theme", 3 | "version": "0.1.0", 4 | "description": "IO Lab's JupyterLab Theme", 5 | "keywords": [ 6 | "jupyter", 7 | "jupyterlab", 8 | "jupyterlab-extension" 9 | ], 10 | "homepage": "https://github.com/railsonsousa/jupyterlab-iolab-theme", 11 | "bugs": { 12 | "url": "https://github.com/railsonsousa/jupyterlab-iolab-theme/issues" 13 | }, 14 | "license": "BSD-3-Clause", 15 | "author": "Railson Sousa", 16 | "files": [ 17 | "lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}", 18 | "style/**/*.{css,eot,gif,html,jpg,json,png,svg,woff2,ttf}" 19 | ], 20 | "main": "lib/index.js", 21 | "types": "lib/index.d.ts", 22 | "repository": { 23 | "type": "git", 24 | "url": "git@railsonsousa106.github.com:/railsonsousa/jupyterlab-iolab-theme.git" 25 | }, 26 | "scripts": { 27 | "build": "jlpm run build:lib && jlpm run build:labextension:dev", 28 | "build:prod": "jlpm run build:lib && jlpm run build:labextension", 29 | "build:labextension": "jupyter labextension build .", 30 | "build:labextension:dev": "jupyter labextension build --development True .", 31 | "build:lib": "tsc", 32 | "clean": "jlpm run clean:lib", 33 | "clean:lib": "rimraf lib tsconfig.tsbuildinfo", 34 | "clean:labextension": "rimraf jupyterlab_iolab_theme/labextension", 35 | "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", 36 | "eslint": "eslint . --ext .ts,.tsx --fix", 37 | "eslint:check": "eslint . --ext .ts,.tsx", 38 | "install:extension": "jupyter labextension develop --overwrite .", 39 | "prepare": "jlpm run clean && jlpm run build:prod", 40 | "watch": "run-p watch:src watch:labextension", 41 | "watch:src": "tsc -w", 42 | "watch:labextension": "jupyter labextension watch ." 43 | }, 44 | "dependencies": { 45 | "@jupyterlab/application": "^3.0.0" 46 | }, 47 | "devDependencies": { 48 | "@jupyterlab/builder": "^3.0.0", 49 | "@typescript-eslint/eslint-plugin": "^2.27.0", 50 | "@typescript-eslint/parser": "^2.27.0", 51 | "eslint": "^7.5.0", 52 | "eslint-config-prettier": "^6.10.1", 53 | "eslint-plugin-prettier": "^3.1.2", 54 | "npm-run-all": "^4.1.5", 55 | "prettier": "^1.19.0", 56 | "rimraf": "^3.0.2", 57 | "typescript": "~4.0.3" 58 | }, 59 | "sideEffects": [ 60 | "style/*.css" 61 | ], 62 | "jupyterlab": { 63 | "extension": true, 64 | "themePath": "style/index.css", 65 | "outputDir": "jupyterlab_iolab_theme/labextension" 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["jupyter_packaging~=0.7.9", "jupyterlab>=3.0.0,==3.*", "setuptools>=40.8.0", "wheel"] 3 | build-backend = "setuptools.build_meta" 4 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | """ 2 | jupyterlab_iolab_theme setup 3 | """ 4 | import json 5 | import os 6 | 7 | from jupyter_packaging import ( 8 | create_cmdclass, install_npm, ensure_targets, 9 | combine_commands, skip_if_exists, 10 | ) 11 | import setuptools 12 | 13 | HERE = os.path.abspath(os.path.dirname(__file__)) 14 | 15 | # The name of the project 16 | name = "jupyterlab_iolab_theme" 17 | 18 | # Get our version 19 | with open(os.path.join(HERE, 'package.json')) as f: 20 | version = json.load(f)['version'] 21 | 22 | lab_path = os.path.join(HERE, name, "labextension") 23 | 24 | # Representative files that should exist after a successful build 25 | jstargets = [ 26 | os.path.join(lab_path, "package.json"), 27 | ] 28 | 29 | package_data_spec = { 30 | name: [ 31 | "*" 32 | ] 33 | } 34 | 35 | labext_name = "@aimarket/jupyterlab-iolab-theme" 36 | 37 | data_files_spec = [ 38 | ("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"), 39 | ("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"), 40 | ] 41 | 42 | cmdclass = create_cmdclass( 43 | "jsdeps", 44 | package_data_spec=package_data_spec, 45 | data_files_spec=data_files_spec 46 | ) 47 | 48 | js_command = combine_commands( 49 | install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]), 50 | ensure_targets(jstargets), 51 | ) 52 | 53 | is_repo = os.path.exists(os.path.join(HERE, '.git')) 54 | if is_repo: 55 | cmdclass['jsdeps'] = js_command 56 | else: 57 | cmdclass['jsdeps'] = skip_if_exists(jstargets, js_command) 58 | 59 | 60 | with open("README.md", "r") as fh: 61 | long_description = fh.read() 62 | 63 | setup_args = dict( 64 | name=name, 65 | version=version, 66 | url="git@railsonsousa106.github.com:/railsonsousa/jupyterlab-iolab-theme", 67 | author="Railson Sousa", 68 | description="IO Lab's JupyterLab Theme", 69 | long_description=long_description, 70 | long_description_content_type="text/markdown", 71 | cmdclass=cmdclass, 72 | packages=setuptools.find_packages(), 73 | install_requires=[ 74 | "jupyterlab>=3.0.0,==3.*", 75 | ], 76 | zip_safe=False, 77 | include_package_data=True, 78 | python_requires=">=3.6", 79 | license="BSD-3-Clause", 80 | platforms="Linux, Mac OS X, Windows", 81 | keywords=["Jupyter", "JupyterLab"], 82 | classifiers=[ 83 | "License :: OSI Approved :: BSD License", 84 | "Programming Language :: Python", 85 | "Programming Language :: Python :: 3", 86 | "Programming Language :: Python :: 3.6", 87 | "Programming Language :: Python :: 3.7", 88 | "Programming Language :: Python :: 3.8", 89 | "Framework :: Jupyter", 90 | "Framework :: Jupyter :: JupyterLab :: 3", 91 | "Framework :: Jupyter :: JupyterLab :: Extensions", 92 | "Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt", 93 | "Framework :: Jupyter :: JupyterLab :: Extensions :: Themes", 94 | ], 95 | ) 96 | 97 | 98 | if __name__ == "__main__": 99 | setuptools.setup(**setup_args) 100 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { 2 | JupyterFrontEnd, 3 | JupyterFrontEndPlugin 4 | } from '@jupyterlab/application'; 5 | 6 | import { IThemeManager } from '@jupyterlab/apputils'; 7 | 8 | /** 9 | * Initialization data for the @aimarket/jupyterlab-iolab-theme extension. 10 | */ 11 | const extension: JupyterFrontEndPlugin = { 12 | id: '@aimarket/jupyterlab-iolab-theme', 13 | requires: [IThemeManager], 14 | autoStart: true, 15 | activate: (app: JupyterFrontEnd, manager: IThemeManager) => { 16 | console.log('JupyterLab extension @aimarket/jupyterlab-iolab-theme is activated!'); 17 | const style = '@aimarket/jupyterlab-iolab-theme/index.css'; 18 | 19 | manager.register({ 20 | name: '@aimarket/jupyterlab-iolab-theme', 21 | isLight: true, 22 | load: () => manager.loadCSS(style), 23 | unload: () => Promise.resolve(undefined) 24 | }); 25 | } 26 | }; 27 | 28 | export default extension; 29 | -------------------------------------------------------------------------------- /style/index.css: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | | Copyright (c) Jupyter Development Team. 3 | | Distributed under the terms of the Modified BSD License. 4 | |----------------------------------------------------------------------------*/ 5 | 6 | @import './variables.css'; 7 | 8 | /* Set the default typography for monospace elements */ 9 | tt, 10 | code, 11 | kbd, 12 | samp, 13 | pre { 14 | font-family: var(--jp-code-font-family); 15 | font-size: var(--jp-code-font-size); 16 | line-height: var(--jp-code-line-height); 17 | } 18 | -------------------------------------------------------------------------------- /style/variables.css: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | | Copyright (c) Jupyter Development Team. 3 | | Distributed under the terms of the Modified BSD License. 4 | |----------------------------------------------------------------------------*/ 5 | 6 | /* 7 | The following CSS variables define the main, public API for styling JupyterLab. 8 | These variables should be used by all plugins wherever possible. In other 9 | words, plugins should not define custom colors, sizes, etc unless absolutely 10 | necessary. This enables users to change the visual theme of JupyterLab 11 | by changing these variables. 12 | 13 | Many variables appear in an ordered sequence (0,1,2,3). These sequences 14 | are designed to work well together, so for example, `--jp-border-color1` should 15 | be used with `--jp-layout-color1`. The numbers have the following meanings: 16 | 17 | * 0: super-primary, reserved for special emphasis 18 | * 1: primary, most important under normal situations 19 | * 2: secondary, next most important under normal situations 20 | * 3: tertiary, next most important under normal situations 21 | 22 | Throughout JupyterLab, we are mostly following principles from Google's 23 | Material Design when selecting colors. We are not, however, following 24 | all of MD as it is not optimized for dense, information rich UIs. 25 | */ 26 | 27 | :root { 28 | /* Elevation 29 | * 30 | * We style box-shadows using Material Design's idea of elevation. These particular numbers are taken from here: 31 | * 32 | * https://github.com/material-components/material-components-web 33 | * https://material-components-web.appspot.com/elevation.html 34 | */ 35 | 36 | --jp-shadow-base-lightness: 0; 37 | --jp-shadow-umbra-color: rgba( 38 | var(--jp-shadow-base-lightness), 39 | var(--jp-shadow-base-lightness), 40 | var(--jp-shadow-base-lightness), 41 | 0.2 42 | ); 43 | --jp-shadow-penumbra-color: rgba( 44 | var(--jp-shadow-base-lightness), 45 | var(--jp-shadow-base-lightness), 46 | var(--jp-shadow-base-lightness), 47 | 0.14 48 | ); 49 | --jp-shadow-ambient-color: rgba( 50 | var(--jp-shadow-base-lightness), 51 | var(--jp-shadow-base-lightness), 52 | var(--jp-shadow-base-lightness), 53 | 0.12 54 | ); 55 | --jp-elevation-z0: none; 56 | --jp-elevation-z1: 0px 2px 1px -1px var(--jp-shadow-umbra-color), 57 | 0px 1px 1px 0px var(--jp-shadow-penumbra-color), 58 | 0px 1px 3px 0px var(--jp-shadow-ambient-color); 59 | --jp-elevation-z2: 0px 3px 1px -2px var(--jp-shadow-umbra-color), 60 | 0px 2px 2px 0px var(--jp-shadow-penumbra-color), 61 | 0px 1px 5px 0px var(--jp-shadow-ambient-color); 62 | --jp-elevation-z4: 0px 2px 4px -1px var(--jp-shadow-umbra-color), 63 | 0px 4px 5px 0px var(--jp-shadow-penumbra-color), 64 | 0px 1px 10px 0px var(--jp-shadow-ambient-color); 65 | --jp-elevation-z6: 0px 3px 5px -1px var(--jp-shadow-umbra-color), 66 | 0px 6px 10px 0px var(--jp-shadow-penumbra-color), 67 | 0px 1px 18px 0px var(--jp-shadow-ambient-color); 68 | --jp-elevation-z8: 0px 5px 5px -3px var(--jp-shadow-umbra-color), 69 | 0px 8px 10px 1px var(--jp-shadow-penumbra-color), 70 | 0px 3px 14px 2px var(--jp-shadow-ambient-color); 71 | --jp-elevation-z12: 0px 7px 8px -4px var(--jp-shadow-umbra-color), 72 | 0px 12px 17px 2px var(--jp-shadow-penumbra-color), 73 | 0px 5px 22px 4px var(--jp-shadow-ambient-color); 74 | --jp-elevation-z16: 0px 8px 10px -5px var(--jp-shadow-umbra-color), 75 | 0px 16px 24px 2px var(--jp-shadow-penumbra-color), 76 | 0px 6px 30px 5px var(--jp-shadow-ambient-color); 77 | --jp-elevation-z20: 0px 10px 13px -6px var(--jp-shadow-umbra-color), 78 | 0px 20px 31px 3px var(--jp-shadow-penumbra-color), 79 | 0px 8px 38px 7px var(--jp-shadow-ambient-color); 80 | --jp-elevation-z24: 0px 11px 15px -7px var(--jp-shadow-umbra-color), 81 | 0px 24px 38px 3px var(--jp-shadow-penumbra-color), 82 | 0px 9px 46px 8px var(--jp-shadow-ambient-color); 83 | 84 | /* Borders 85 | * 86 | * The following variables, specify the visual styling of borders in JupyterLab. 87 | */ 88 | 89 | --jp-border-width: 1px; 90 | --jp-border-color0: var(--md-grey-400); 91 | --jp-border-color1: var(--md-grey-400); 92 | --jp-border-color2: var(--md-grey-300); 93 | --jp-border-color3: var(--md-grey-200); 94 | --jp-border-radius: 2px; 95 | 96 | /* UI Fonts 97 | * 98 | * The UI font CSS variables are used for the typography all of the JupyterLab 99 | * user interface elements that are not directly user generated content. 100 | * 101 | * The font sizing here is done assuming that the body font size of --jp-ui-font-size1 102 | * is applied to a parent element. When children elements, such as headings, are sized 103 | * in em all things will be computed relative to that body size. 104 | */ 105 | 106 | --jp-ui-font-scale-factor: 1.2; 107 | --jp-ui-font-size0: 0.83333em; 108 | --jp-ui-font-size1: 13px; /* Base font size */ 109 | --jp-ui-font-size2: 1.2em; 110 | --jp-ui-font-size3: 1.44em; 111 | 112 | --jp-ui-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, 113 | Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; 114 | 115 | /* 116 | * Use these font colors against the corresponding main layout colors. 117 | * In a light theme, these go from dark to light. 118 | */ 119 | 120 | /* Defaults use Material Design specification */ 121 | --jp-ui-font-color0: rgba(0, 0, 0, 1); 122 | --jp-ui-font-color1: rgba(0, 0, 0, 0.87); 123 | --jp-ui-font-color2: rgba(0, 0, 0, 0.54); 124 | --jp-ui-font-color3: rgba(0, 0, 0, 0.38); 125 | 126 | /* 127 | * Use these against the brand/accent/warn/error colors. 128 | * These will typically go from light to darker, in both a dark and light theme. 129 | */ 130 | 131 | --jp-ui-inverse-font-color0: rgba(255, 255, 255, 1); 132 | --jp-ui-inverse-font-color1: rgba(255, 255, 255, 1); 133 | --jp-ui-inverse-font-color2: rgba(255, 255, 255, 0.7); 134 | --jp-ui-inverse-font-color3: rgba(255, 255, 255, 0.5); 135 | 136 | /* Content Fonts 137 | * 138 | * Content font variables are used for typography of user generated content. 139 | * 140 | * The font sizing here is done assuming that the body font size of --jp-content-font-size1 141 | * is applied to a parent element. When children elements, such as headings, are sized 142 | * in em all things will be computed relative to that body size. 143 | */ 144 | 145 | --jp-content-line-height: 1.6; 146 | --jp-content-font-scale-factor: 1.2; 147 | --jp-content-font-size0: 0.83333em; 148 | --jp-content-font-size1: 14px; /* Base font size */ 149 | --jp-content-font-size2: 1.2em; 150 | --jp-content-font-size3: 1.44em; 151 | --jp-content-font-size4: 1.728em; 152 | --jp-content-font-size5: 2.0736em; 153 | 154 | /* This gives a magnification of about 125% in presentation mode over normal. */ 155 | --jp-content-presentation-font-size1: 17px; 156 | 157 | --jp-content-heading-line-height: 1; 158 | --jp-content-heading-margin-top: 1.2em; 159 | --jp-content-heading-margin-bottom: 0.8em; 160 | --jp-content-heading-font-weight: 500; 161 | 162 | /* Defaults use Material Design specification */ 163 | --jp-content-font-color0: rgba(0, 0, 0, 1); 164 | --jp-content-font-color1: rgba(0, 0, 0, 0.87); 165 | --jp-content-font-color2: rgba(0, 0, 0, 0.54); 166 | --jp-content-font-color3: rgba(0, 0, 0, 0.38); 167 | 168 | --jp-content-link-color: var(--md-blue-700); 169 | 170 | --jp-content-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 171 | Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 172 | 'Segoe UI Symbol'; 173 | 174 | /* 175 | * Code Fonts 176 | * 177 | * Code font variables are used for typography of code and other monospaces content. 178 | */ 179 | 180 | --jp-code-font-size: 13px; 181 | --jp-code-line-height: 1.3077; /* 17px for 13px base */ 182 | --jp-code-padding: 0.385em; /* 5px for 13px base */ 183 | --jp-code-font-family-default: Menlo, Consolas, 'DejaVu Sans Mono', monospace; 184 | --jp-code-font-family: var(--jp-code-font-family-default); 185 | 186 | /* This gives a magnification of about 125% in presentation mode over normal. */ 187 | --jp-code-presentation-font-size: 16px; 188 | 189 | /* may need to tweak cursor width if you change font size */ 190 | --jp-code-cursor-width0: 1.4px; 191 | --jp-code-cursor-width1: 2px; 192 | --jp-code-cursor-width2: 4px; 193 | 194 | /* Layout 195 | * 196 | * The following are the main layout colors use in JupyterLab. In a light 197 | * theme these would go from light to dark. 198 | */ 199 | 200 | --jp-layout-color0: white; 201 | --jp-layout-color1: white; 202 | --jp-layout-color2: var(--md-grey-200); 203 | --jp-layout-color3: var(--md-grey-400); 204 | --jp-layout-color4: var(--md-grey-600); 205 | 206 | /* Inverse Layout 207 | * 208 | * The following are the inverse layout colors use in JupyterLab. In a light 209 | * theme these would go from dark to light. 210 | */ 211 | 212 | --jp-inverse-layout-color0: #111111; 213 | --jp-inverse-layout-color1: var(--md-grey-900); 214 | --jp-inverse-layout-color2: var(--md-grey-800); 215 | --jp-inverse-layout-color3: var(--md-grey-700); 216 | --jp-inverse-layout-color4: var(--md-grey-600); 217 | 218 | /* Brand/accent */ 219 | 220 | --jp-brand-color0: var(--md-blue-700); 221 | --jp-brand-color1: var(--md-blue-500); 222 | --jp-brand-color2: var(--md-blue-300); 223 | --jp-brand-color3: var(--md-blue-100); 224 | 225 | --jp-accent-color0: var(--md-green-700); 226 | --jp-accent-color1: var(--md-green-500); 227 | --jp-accent-color2: var(--md-green-300); 228 | --jp-accent-color3: var(--md-green-100); 229 | 230 | /* State colors (warn, error, success, info) */ 231 | 232 | --jp-warn-color0: var(--md-orange-700); 233 | --jp-warn-color1: var(--md-orange-500); 234 | --jp-warn-color2: var(--md-orange-300); 235 | --jp-warn-color3: var(--md-orange-100); 236 | 237 | --jp-error-color0: var(--md-red-700); 238 | --jp-error-color1: var(--md-red-500); 239 | --jp-error-color2: var(--md-red-300); 240 | --jp-error-color3: var(--md-red-100); 241 | 242 | --jp-success-color0: var(--md-green-700); 243 | --jp-success-color1: var(--md-green-500); 244 | --jp-success-color2: var(--md-green-300); 245 | --jp-success-color3: var(--md-green-100); 246 | 247 | --jp-info-color0: var(--md-cyan-700); 248 | --jp-info-color1: var(--md-cyan-500); 249 | --jp-info-color2: var(--md-cyan-300); 250 | --jp-info-color3: var(--md-cyan-100); 251 | 252 | /* Cell specific styles */ 253 | 254 | --jp-cell-padding: 5px; 255 | 256 | --jp-cell-collapser-width: 8px; 257 | --jp-cell-collapser-min-height: 20px; 258 | --jp-cell-collapser-not-active-hover-opacity: 0.6; 259 | 260 | --jp-cell-editor-background: var(--md-grey-100); 261 | --jp-cell-editor-border-color: var(--md-grey-300); 262 | --jp-cell-editor-box-shadow: inset 0 0 2px var(--md-blue-300); 263 | --jp-cell-editor-active-background: var(--jp-layout-color0); 264 | --jp-cell-editor-active-border-color: var(--jp-brand-color1); 265 | 266 | --jp-cell-prompt-width: 64px; 267 | --jp-cell-prompt-font-family: 'Source Code Pro', monospace; 268 | --jp-cell-prompt-letter-spacing: 0px; 269 | --jp-cell-prompt-opacity: 1; 270 | --jp-cell-prompt-not-active-opacity: 0.5; 271 | --jp-cell-prompt-not-active-font-color: var(--md-grey-700); 272 | /* A custom blend of MD grey and blue 600 273 | * See https://meyerweb.com/eric/tools/color-blend/#546E7A:1E88E5:5:hex */ 274 | --jp-cell-inprompt-font-color: #307fc1; 275 | /* A custom blend of MD grey and orange 600 276 | * https://meyerweb.com/eric/tools/color-blend/#546E7A:F4511E:5:hex */ 277 | --jp-cell-outprompt-font-color: #bf5b3d; 278 | 279 | /* Notebook specific styles */ 280 | 281 | --jp-notebook-padding: 10px; 282 | --jp-notebook-select-background: var(--jp-layout-color1); 283 | --jp-notebook-multiselected-color: var(--md-blue-50); 284 | 285 | /* The scroll padding is calculated to fill enough space at the bottom of the 286 | notebook to show one single-line cell (with appropriate padding) at the top 287 | when the notebook is scrolled all the way to the bottom. We also subtract one 288 | pixel so that no scrollbar appears if we have just one single-line cell in the 289 | notebook. This padding is to enable a 'scroll past end' feature in a notebook. 290 | */ 291 | --jp-notebook-scroll-padding: calc( 292 | 100% - var(--jp-code-font-size) * var(--jp-code-line-height) - 293 | var(--jp-code-padding) - var(--jp-cell-padding) - 1px 294 | ); 295 | 296 | /* Rendermime styles */ 297 | 298 | --jp-rendermime-error-background: #fdd; 299 | --jp-rendermime-table-row-background: var(--md-grey-100); 300 | --jp-rendermime-table-row-hover-background: var(--md-light-blue-50); 301 | 302 | /* Dialog specific styles */ 303 | 304 | --jp-dialog-background: rgba(0, 0, 0, 0.25); 305 | 306 | /* Console specific styles */ 307 | 308 | --jp-console-padding: 10px; 309 | 310 | /* Toolbar specific styles */ 311 | 312 | --jp-toolbar-border-color: var(--jp-border-color1); 313 | --jp-toolbar-micro-height: 8px; 314 | --jp-toolbar-background: var(--jp-layout-color1); 315 | --jp-toolbar-box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.24); 316 | --jp-toolbar-header-margin: 4px 4px 0px 4px; 317 | --jp-toolbar-active-background: var(--md-grey-300); 318 | 319 | /* Input field styles */ 320 | 321 | --jp-input-box-shadow: inset 0 0 2px var(--md-blue-300); 322 | --jp-input-active-background: var(--jp-layout-color1); 323 | --jp-input-hover-background: var(--jp-layout-color1); 324 | --jp-input-background: var(--md-grey-100); 325 | --jp-input-border-color: var(--jp-border-color1); 326 | --jp-input-active-border-color: var(--jp-brand-color1); 327 | 328 | /* General editor styles */ 329 | 330 | --jp-editor-selected-background: #d9d9d9; 331 | --jp-editor-selected-focused-background: #d7d4f0; 332 | --jp-editor-cursor-color: var(--jp-ui-font-color0); 333 | 334 | /* Code mirror specific styles */ 335 | 336 | --jp-mirror-editor-keyword-color: #008000; 337 | --jp-mirror-editor-atom-color: #88f; 338 | --jp-mirror-editor-number-color: #080; 339 | --jp-mirror-editor-def-color: #00f; 340 | --jp-mirror-editor-variable-color: var(--md-grey-900); 341 | --jp-mirror-editor-variable-2-color: #05a; 342 | --jp-mirror-editor-variable-3-color: #085; 343 | --jp-mirror-editor-punctuation-color: #05a; 344 | --jp-mirror-editor-property-color: #05a; 345 | --jp-mirror-editor-operator-color: #aa22ff; 346 | --jp-mirror-editor-comment-color: #408080; 347 | --jp-mirror-editor-string-color: #ba2121; 348 | --jp-mirror-editor-string-2-color: #708; 349 | --jp-mirror-editor-meta-color: #aa22ff; 350 | --jp-mirror-editor-qualifier-color: #555; 351 | --jp-mirror-editor-builtin-color: #008000; 352 | --jp-mirror-editor-bracket-color: #997; 353 | --jp-mirror-editor-tag-color: #170; 354 | --jp-mirror-editor-attribute-color: #00c; 355 | --jp-mirror-editor-header-color: blue; 356 | --jp-mirror-editor-quote-color: #090; 357 | --jp-mirror-editor-link-color: #00c; 358 | --jp-mirror-editor-error-color: #f00; 359 | --jp-mirror-editor-hr-color: #999; 360 | 361 | /* Vega extension styles */ 362 | 363 | --jp-vega-background: white; 364 | 365 | /* Sidebar-related styles */ 366 | 367 | --jp-sidebar-min-width: 180px; 368 | } 369 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "composite": true, 5 | "declaration": true, 6 | "esModuleInterop": true, 7 | "incremental": true, 8 | "jsx": "react", 9 | "module": "esnext", 10 | "moduleResolution": "node", 11 | "noEmitOnError": true, 12 | "noImplicitAny": true, 13 | "noUnusedLocals": true, 14 | "preserveWatchOutput": true, 15 | "resolveJsonModule": true, 16 | "outDir": "lib", 17 | "rootDir": "src", 18 | "strict": true, 19 | "strictNullChecks": false, 20 | "target": "es2017", 21 | "types": [] 22 | }, 23 | "include": ["src/*"] 24 | } 25 | --------------------------------------------------------------------------------