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 github light #49

Merged
merged 18 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from 12 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
32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ This repository defines a set of accessible themes according to [WCAG color stan

## Themes

- [Pitaya Smoothie](./packages/pitaya_smoothie/README.md) - Color-blind friendly

- [Pitaya Smoothie](./packages/pitayasmoothie/README.md) - Color-blind friendly
- [GitHub light](./packages/githublight/README.md) - Color-blind friendly

## 📦 Requirements

Expand Down Expand Up @@ -80,32 +80,39 @@ pip uninstall jupyterlab_accessible_themes
git clone https://github.com/Quansight-Labs/jupyterlab-accessible-themes.git
```

2. Change to the `jupyterlab_accessible_themes` directory
2. Change to the `jupyterlab-accessible-themes` directory

```bash
cd jupyterlab_accessible_themes
cd jupyterlab-accessible-themes
```

3. Install the package in development mode

```bash
pip install -e .
```

4. Now you'll need to link the development version of the extension to JupyterLab and rebuild the Typescript source:
3. Install the node dependencies and build the extension

```bash
# Install jupyterlab 3.x
pip install jupyterlab < 4.0
steff456 marked this conversation as resolved.
Show resolved Hide resolved

# Install node dependencies
jlpm install

# Compile packages before linking to Jupyterlab development version
jlpm build
```

4. Install the package in development mode

```bash
pip install -e .
```

5. Now you'll need to link the development version of the extension to JupyterLab and rebuild the Typescript source:

```bash
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
```

5. After doing some changes, to visualize them in your local Jupyterlab please re-run the following command:
6. After doing some changes, to visualize them in your local Jupyterlab please re-run the following command:
steff456 marked this conversation as resolved.
Show resolved Hide resolved

steff456 marked this conversation as resolved.
Show resolved Hide resolved
```bash
# Rebuild extension Typescript source after making changes
Expand Down Expand Up @@ -213,3 +220,4 @@ Detailed instructions for creating a `jupyterlab-accesible-themes` can be found
We want to thank the following sources for being the source of inspiration for one or more themes that are available in this repository,

- [Pitaya Smoothie theme](https://github.com/trallard/pitaya_smoothie)
- [GitHub's VS Code themes](https://github.com/primer/github-vscode-theme)
52 changes: 52 additions & 0 deletions packages/githublight/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# GitHub Light

A theme heavily inspired by the [`GitHub light default theme` for VSCode](https://github.com/primer/github-vscode-theme).

## Usage ✨

To enable the theme from the JupyterLab menu bar. Go to `Settings -> JupyterLab Theme -> Github Light`

## Colors

All the colors used for text in the theme are conformant with [WCAG 2.1 contrast standards](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html).

Background color: ![##ffffff](https://via.placeholder.com/20/#ffffff/#ffffff.png) `#ffffff`

Highlight color: ![#321f7ad9](https://via.placeholder.com/20/321f7ad9/321f7ad9.png) `#321f7ad9`

**WCAG compliance**
steff456 marked this conversation as resolved.
Show resolved Hide resolved
steff456 marked this conversation as resolved.
Show resolved Hide resolved

All the colors in the table shown were tested with the background color.

| Color | Hex | Ratio | Normal text | Large text |
| ------------------------------------------------------------ | --------- | -------- | ----------- | ---------- |
| ![#1F2328](https://via.placeholder.com/20/1F2328/1F2328.png) | `#1F2328` | 15.8 : 1 | AAA | AAA |
| ![#6e7781](https://via.placeholder.com/20/6e7781/6e7781.png) | `#6e7781` | 4.5 : 1 | AA | AAA |
| ![#57606a](https://via.placeholder.com/20/57606a/57606a.png) | `#57606a` | 6.4 : 1 | AA | AAA |
| ![#424a53](https://via.placeholder.com/20/424a53/424a53.png) | `#424a53` | 9.0 : 1 | AAA | AAA |
| ![#32383f](https://via.placeholder.com/20/32383f/32383f.png) | `#32383f` | 11.8 : 1 | AAA | AAA |
| ![#24292f](https://via.placeholder.com/20/24292f/24292f.png) | `#24292f` | 14.7 : 1 | AAA | AAA |
| ![#0550ae](https://via.placeholder.com/20/0550ae/0550ae.png) | `#0550ae` | 7.6 : 1 | AAA | AAA |
| ![#0a3069](https://via.placeholder.com/20/0a3069/0a3069.png) | `#0a3069` | 12.8 : 1 | AAA | AAA |
| ![#116329](https://via.placeholder.com/20/116329/116329.png) | `#116329` | 7.4 : 1 | AAA | AAA |
| ![#953800](https://via.placeholder.com/20/953800/953800.png) | `#953800` | 7.4 : 1 | AAA | AAA |
| ![#a40e26](https://via.placeholder.com/20/a40e26/a40e26.png) | `#a40e26` | 7.9 : 1 | AAA | AAA |
| ![#6639ba](https://via.placeholder.com/20/6639ba/6639ba.png) | `#6639ba` | 7.3 : 1 | AAA | AAA |

## Font

This theme is using the [Atkinson Hyperlegible font](https://brailleinstitute.org/freefont), which focuses on letterform distinction to increase character recognition, ultimately improving readability.

This font can only be changed for the `Markdown viewer` and the `Terminal`. You will need to make these changes from the `Advanced settings` editor in the JupyterLab UI:

1. Select the `Settings` option in the `menu bar`.
2. Go to `Markdown viewer settings`, and type the font family that you want to use.
3. To change the `Terminal` font, scroll down to `Terminal settings` and type the name of the font family.

## Screenshots

<img alt="JupyterLab GitHub Light screenshot" src="./images/screenshot.png"/>

## Acknowledgements

This theme is based on and inspired by the [`GitHub Light Default` theme for VSCode](https://github.com/primer/github-vscode-theme)
Binary file added packages/githublight/images/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions packages/githublight/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "@jupyterlab-accessible-themes/jupyterlab-theme-githublight",
"version": "0.1.0",
"description": "GitHub Light in JupyterLab: a theme based on GitHub light interface colors. The colors are optimized for some types of color blindness.",
"license": "BSD-3-Clause",
"author": "Jupyter Accessibility Team",
"homepage": "https://github.com/Quansight-Labs/jupyterlab-accessible-themes",
"repository": {
"type": "git",
"url": "https://github.com/Quansight-Labs/jupyterlab-accessible-themes"
},
"bugs": {
"url": "https://github.com/Quansight-Labs/jupyterlab-accessible-themes"
},
"main": "lib/index.js",
"files": [
"{lib,style,src}/**/*.{.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf,css}"
],
"scripts": {
"build:lib": "tsc -b",
"build:ext": "jupyter labextension build --debug .",
"watch:lib": "tsc -b -w --preserveWatchOutput",
"watch:ext": "jupyter labextension watch --debug ."
},
"sideEffects": [
"style/*.css"
],
"types": "lib/index.d.ts",
"dependencies": {
"@jupyterlab/application": "^3.1.0",
"@jupyterlab/apputils": "^3.1.0",
"@jupyterlab/settingregistry": "^3.1.0"
},
"devDependencies": {
"@jupyterlab/builder": "^3.0.2",
"base64-inline-loader": "^1.1.1"
},
"keywords": [
"jupyter",
"jupyterlab",
"jupyterlab-extension"
],
"jupyterlab": {
"themePath": "style/index.css",
"extension": "lib/index.js",
"discovery": {
"server": {
"base": {
"name": "jupyterlab-accessible-themes"
},
"managers": [
"pip"
]
}
},
"outputDir": "../../jupyterlab_accessible_themes/labextensions/githublight"
}
}
62 changes: 62 additions & 0 deletions packages/githublight/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright (c) Jupyter Accessibility Team.
// Distributed under the terms of the Modified BSD License.

import {
JupyterFrontEnd,
JupyterFrontEndPlugin,
} from "@jupyterlab/application";

import { IThemeManager } from "@jupyterlab/apputils";

import { ISettingRegistry } from "@jupyterlab/settingregistry";

/**
* Initialization data for the jupyterlab-accessible-themes extension.
*/
const plugin: JupyterFrontEndPlugin<void> = {
// NOTE: The package id cannot contain a dash or underscore, so we need
// to remove it here.
id: "jupyterlab-accessible-themes:githublight",
autoStart: true,
requires: [IThemeManager],
optional: [ISettingRegistry],
activate: (
app: JupyterFrontEnd,
manager: IThemeManager,
settingRegistry: ISettingRegistry | null
) => {
console.log(
"JupyterLab extension jupyterlab-accessible-themes is activated!"
);
// NOTE: The package name cannot contain a dash or underscore, so we need
// to remove it for the installation folder name.
const style =
"@jupyterlab-accessible-themes/jupyterlab-theme-githublight/index.css";

manager.register({
name: "GitHub Light",
isLight: true,
load: () => manager.loadCSS(style),
unload: () => Promise.resolve(undefined),
});

if (settingRegistry) {
settingRegistry
.load(plugin.id)
.then((settings) => {
console.log(
"jupyterlab-accessible-themes settings loaded:",
settings.composite
);
})
.catch((reason) => {
console.error(
"Failed to load settings for jupyterlab-accessible-themes.",
reason
);
});
}
},
};

export default plugin;
101 changes: 101 additions & 0 deletions packages/githublight/style/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading