Skip to content

Commit ab7b19d

Browse files
committed
Add CSS classes ansi-default-inverse-fg and ...-bg
1 parent 0684645 commit ab7b19d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

notebook/static/base/js/utils.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,21 +247,23 @@ define([
247247
fg += 8; // Bold text uses "intense" colors
248248
}
249249
if (inverse) {
250-
if (fg.length === 0) { fg = [0, 0, 0]; }
251-
if (bg.length === 0) { bg = [255, 255, 255]; }
252250
[fg, bg] = [bg, fg];
253251
}
254252

255253
if (typeof fg === "number") {
256254
classes.push(_ANSI_COLORS[fg] + "-fg");
257255
} else if (fg.length) {
258256
styles.push("color: rgb(" + fg + ")");
257+
} else if (inverse) {
258+
classes.push("ansi-default-inverse-fg");
259259
}
260260

261261
if (typeof bg === "number") {
262262
classes.push(_ANSI_COLORS[bg] + "-bg");
263263
} else if (bg.length) {
264264
styles.push("background-color: rgb(" + bg + ")");
265+
} else if (inverse) {
266+
classes.push("ansi-default-inverse-bg");
265267
}
266268

267269
if (bold) {

notebook/static/notebook/less/ansicolors.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
.ansicolors(cyan, #60C6C8, #258F8F);
2121
.ansicolors(white, #C5C1B4, #A1A6B2);
2222

23+
.ansi-default-inverse-fg { color: #FFFFFF; }
24+
.ansi-default-inverse-bg { background-color: #000000; }
25+
2326
.ansi-bold { font-weight: bold; }
2427
.ansi-underline { text-decoration: underline; }
2528

0 commit comments

Comments
 (0)