Skip to content

Commit 8828c77

Browse files
authored
nbdime styles are not imported (#919)
* Import some styles from nbdime-jupyterlab * Import additional styles from nbdime * Move import to base * Correct comment position
1 parent ecd211f commit 8828c77

File tree

4 files changed

+94
-4
lines changed

4 files changed

+94
-4
lines changed

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { GitWidget } from './widgets/GitWidget';
2828

2929
export { NotebookDiff } from './components/diff/NotebookDiff';
3030
export { PlainTextDiff } from './components/diff/PlainTextDiff';
31+
export { DiffModel } from './components/diff/model';
3132
export { Git, IGitExtension } from './tokens';
3233

3334
/**

style/base.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
| Distributed under the terms of the Modified BSD License.
44
|----------------------------------------------------------------------------*/
55

6+
/* Import same style from nbdime than nbdime-jupyterlab
7+
* see index.ts
8+
*/
9+
@import url('~nbdime/lib/common/collapsible.css');
10+
@import url('~nbdime/lib/upstreaming/flexpanel.css');
11+
@import url('~nbdime/lib/common/dragpanel.css');
12+
@import url('~nbdime/lib/styles/variables.css');
13+
@import url('~nbdime/lib/styles/common.css');
14+
@import url('~nbdime/lib/styles/diff.css');
15+
@import url('~nbdime/lib/styles/merge.css');
16+
617
@import url('diff-common.css');
718
@import url('diff-nb.css');
819
@import url('diff-text.css');

style/diff-nb.css

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,85 @@
6060
background-color: var(--jp-git-diff-deleted-color);
6161
border: none;
6262
}
63+
64+
/* Imported from nbdime-jupyterlab */
65+
.jp-git-diff-root .nbdime-Widget {
66+
display: flex;
67+
flex-direction: column;
68+
}
69+
70+
.jp-git-diff-root .nbdime-root {
71+
padding: var(--jp-notebook-padding);
72+
min-width: 50px;
73+
min-height: 50px;
74+
outline: none;
75+
overflow: auto;
76+
background: var(--jp-layout-color0);
77+
color: var(--jp-ui-font-color0);
78+
flex: 1 1 auto;
79+
}
80+
81+
82+
/* Header syling */
83+
84+
.jp-git-diff-root .nbdime-Diff {
85+
border-bottom: var(--jp-border-width) solid var(--jp-toolbar-border-color);
86+
box-shadow: var(--jp-toolbar-box-shadow);
87+
background: var(--jp-toolbar-background);
88+
color: var(--jp-ui-font-color1);
89+
flex: 0 0 auto;
90+
padding: 2px;
91+
z-index: 1;
92+
}
93+
94+
/* Hiding unchanged cells if told to */
95+
.jp-git-diff-root .nbdime-root.jp-mod-hideUnchanged .jp-Cell-diff.jp-Diff-unchanged {
96+
display: none;
97+
}
98+
99+
/* Show a marker with the number of cells hidden before */
100+
.jp-git-diff-root .nbdime-root.jp-mod-hideUnchanged .jp-Cell-diff[data-nbdime-NCellsHiddenBefore]::before,
101+
.jp-git-diff-root .nbdime-root.jp-mod-hideUnchanged .jp-Diff-addremchunk[data-nbdime-NCellsHiddenBefore]::before {
102+
content: attr(data-nbdime-NCellsHiddenBefore) " unchanged cell(s) hidden";
103+
position: absolute;
104+
width: 100%;
105+
top: 0;
106+
background-color: var(--jp-layout-color2);
107+
border-top: solid var(--jp-layout-color3) 1px;
108+
border-bottom: solid var(--jp-layout-color3) 1px;
109+
text-align: center;
110+
}
111+
112+
/* Show a marker with the number of cells hidden after (for hidden cells at end) */
113+
.jp-git-diff-root .nbdime-root.jp-mod-hideUnchanged .jp-Cell-diff[data-nbdime-NCellsHiddenAfter]::after,
114+
.jp-git-diff-root .nbdime-root.jp-mod-hideUnchanged .jp-Diff-addremchunk[data-nbdime-NCellsHiddenAfter]::after {
115+
content: attr(data-nbdime-NCellsHiddenAfter) " unchanged cell(s) hidden";
116+
position: absolute;
117+
width: 100%;
118+
bottom: 0;
119+
background-color: var(--jp-layout-color2);
120+
border-top: solid var(--jp-layout-color3) 1px;
121+
border-bottom: solid var(--jp-layout-color3) 1px;
122+
text-align: center;
123+
}
124+
125+
.jp-git-diff-root .nbdime-root.jp-mod-hideUnchanged .jp-Cell-diff[data-nbdime-NCellsHiddenBefore],
126+
.jp-git-diff-root .nbdime-root.jp-mod-hideUnchanged .jp-Diff-addremchunk[data-nbdime-NCellsHiddenBefore] {
127+
padding-top: 40px;
128+
}
129+
130+
.jp-git-diff-root .nbdime-root.jp-mod-hideUnchanged .jp-Cell-diff[data-nbdime-NCellsHiddenAfter],
131+
.jp-git-diff-root .nbdime-root.jp-mod-hideUnchanged .jp-Diff-addremchunk[data-nbdime-NCellsHiddenAfter] {
132+
padding-bottom: 40px;
133+
}
134+
135+
/* Marker for when all cells are unchanged and hidden */
136+
.jp-git-diff-root .nbdime-root.jp-mod-hideUnchanged .jp-Notebook-diff[data-nbdime-AllCellsHidden]::after {
137+
content: "No changes, " attr(data-nbdime-AllCellsHidden) " unchanged cell(s) hidden";
138+
display: block;
139+
width: 100%;
140+
background-color: var(--jp-layout-color2);
141+
border-top: solid var(--jp-layout-color3) 1px;
142+
border-bottom: solid var(--jp-layout-color3) 1px;
143+
text-align: center;
144+
}

style/index.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
@import url('~nbdime/lib/styles/common.css');
2-
@import url('~nbdime/lib/styles/diff.css');
3-
@import url('~nbdime/lib/styles/merge.css');
4-
@import url('~nbdime/lib/styles/variables.css');
51
@import url('base.css');

0 commit comments

Comments
 (0)