Skip to content

Commit 693afd9

Browse files
Improve toolbar styling (#57)
* Remove most masks from SVGs * Add svgo, compress icons * Improve toolbar styling * Revert "Add svgo, compress icons" This reverts commit 00e9b34. * Fix refresh icon * Improve icon * Also add title to competitions page, add font * Update Playwright Snapshots * Trigger CI --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 8e72c5e commit 693afd9

File tree

14 files changed

+98
-103
lines changed

14 files changed

+98
-103
lines changed

src/pages/competitions.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { JupyterFrontEndPlugin, JupyterFrontEnd } from '@jupyterlab/application'
22
import { MainAreaWidget, ReactWidget } from '@jupyterlab/apputils';
33
import { Commands } from '../commands';
44
import { SidebarIcon } from '../ui-components/SidebarIcon';
5+
import { PageTitle } from '../ui-components/PageTitle';
56
import { EverywhereIcons } from '../icons';
67
import React from 'react';
78

@@ -25,6 +26,11 @@ export const competitions: JupyterFrontEndPlugin<void> = {
2526
widget.title.label = 'Competitions';
2627
widget.title.closable = true;
2728
widget.title.icon = EverywhereIcons.competition;
29+
const toolbarTitle = new PageTitle({
30+
label: 'Competitions',
31+
icon: EverywhereIcons.competition
32+
});
33+
widget.toolbar.addItem('title', toolbarTitle);
2834
return widget;
2935
};
3036
let widget = newWidget();

src/pages/files.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { JupyterFrontEndPlugin, JupyterFrontEnd } from '@jupyterlab/application'
22
import { MainAreaWidget, ReactWidget } from '@jupyterlab/apputils';
33
import { Commands } from '../commands';
44
import { SidebarIcon } from '../ui-components/SidebarIcon';
5+
import { PageTitle } from '../ui-components/PageTitle';
56
import { EverywhereIcons } from '../icons';
67
import React from 'react';
78
import { LabIcon } from '@jupyterlab/ui-components';
@@ -17,7 +18,7 @@ function Tile(props: { icon: LabIcon; label: string }) {
1718
);
1819
}
1920

20-
export class Files extends ReactWidget {
21+
class Files extends ReactWidget {
2122
constructor() {
2223
super();
2324
this.addClass('je-Files');
@@ -30,6 +31,7 @@ export class Files extends ReactWidget {
3031
);
3132
}
3233
}
34+
3335
export const files: JupyterFrontEndPlugin<void> = {
3436
id: 'jupytereverywhere:files',
3537
autoStart: true,
@@ -41,6 +43,11 @@ export const files: JupyterFrontEndPlugin<void> = {
4143
widget.title.label = 'Files';
4244
widget.title.closable = true;
4345
widget.title.icon = EverywhereIcons.folder;
46+
const toolbarTitle = new PageTitle({
47+
label: 'Files',
48+
icon: EverywhereIcons.folder
49+
});
50+
widget.toolbar.addItem('title', toolbarTitle);
4451
return widget;
4552
};
4653
let widget = newWidget();

src/ui-components/PageTitle.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { ReactWidget } from '@jupyterlab/apputils';
2+
import { LabIcon } from '@jupyterlab/ui-components';
3+
import React from 'react';
4+
5+
export class PageTitle extends ReactWidget {
6+
constructor(protected props: { label: string; icon: LabIcon }) {
7+
super();
8+
this.addClass('je-PageTitle');
9+
}
10+
protected render() {
11+
return (
12+
<>
13+
<this.props.icon.react height="24px" />
14+
{this.props.label}
15+
</>
16+
);
17+
}
18+
}

style/base.css

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
44
https://jupyterlab.readthedocs.io/en/stable/developer/css.html
55
*/
6+
7+
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
8+
69
#jp-menu-panel,
710
#jp-top-bar,
811
#jp-top-panel,
@@ -15,6 +18,8 @@
1518

1619
:root {
1720
--je-slate-blue: #412c88;
21+
--je-round-corners: 12px;
22+
--je-font-family: 'Inter', sans-serif;
1823
}
1924

2025
.je-Tile {
@@ -36,18 +41,43 @@
3641
cursor: pointer;
3742
}
3843

44+
.je-PageTitle {
45+
font-weight: 600;
46+
font-family: var(--je-font-family);
47+
}
48+
49+
.jp-SideBar {
50+
/* Override colors in sidebar */
51+
--jp-layout-color1: #e6e6e6;
52+
--jp-layout-color2: #fff;
53+
--jp-border-width: 0px;
54+
}
55+
56+
.jp-Toolbar {
57+
--jp-ui-font-color1: #412c88;
58+
--jp-ui-font-family: var(--je-font-family);
59+
}
60+
61+
.jp-ToolbarButtonComponent-label {
62+
font-weight: 600;
63+
}
64+
3965
#jp-main-dock-panel[data-mode='single-document'] {
4066
padding: 25px !important;
4167
background: #d8b8dc;
4268
}
4369

4470
#jp-main-dock-panel[data-mode='single-document'] .jp-MainAreaWidget {
45-
border-radius: 15px;
71+
border-radius: var(--je-round-corners);
72+
background: transparent;
4673
}
4774

48-
.jp-SideBar {
49-
/* Override colors in sidebar */
50-
--jp-layout-color1: #e6e6e6;
51-
--jp-layout-color2: #fff;
52-
--jp-border-width: 0px;
75+
.jp-MainAreaWidget > .jp-Toolbar {
76+
border-radius: var(--je-round-corners);
77+
}
78+
79+
.jp-MainAreaWidget > :not(.jp-Toolbar) {
80+
border-radius: var(--je-round-corners);
81+
margin-top: 10px;
82+
background: white;
5383
}

style/icons/download-caret.svg

Lines changed: 9 additions & 23 deletions
Loading

style/icons/fast-forward.svg

Lines changed: 2 additions & 22 deletions
Loading

style/icons/link.svg

Lines changed: 4 additions & 4 deletions
Loading

style/icons/refresh.svg

Lines changed: 13 additions & 25 deletions
Loading

style/icons/run.svg

Lines changed: 1 addition & 11 deletions
Loading

style/icons/stop.svg

Lines changed: 1 addition & 11 deletions
Loading

0 commit comments

Comments
 (0)