Skip to content

Commit abb8955

Browse files
committed
Improve SideBySide CSS for nonexistent blocks
Signed-off-by: Jack Cherng <[email protected]>
1 parent 8cb05e8 commit abb8955

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

example/diff-table.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@
7171
.diff-wrapper.diff.diff-html .change.change-eq .new {
7272
background: #fff;
7373
}
74+
.diff-wrapper.diff.diff-html .change.change-ins .old, .diff-wrapper.diff.diff-html .change.change-del .new {
75+
cursor: not-allowed;
76+
background: #ebebeb;
77+
}
7478
.diff-wrapper.diff.diff-html .change .old {
7579
background: #fbe1e1;
7680
}

example/diff-table.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
$table-sidebar-color: mix($bg-color, $text-color, 80%);
2727
$border-color: $text-color;
2828

29+
// color for the nonexistent block
30+
// for example, there are a deleted line that has no corresponding one
31+
$bg-color-nonexistent-block: mix($bg-color, $table-sidebar-color, 60%);
32+
2933
background-color: $bg-color;
3034
border-collapse: collapse;
3135
border-spacing: 0;
@@ -108,6 +112,12 @@
108112
}
109113
}
110114

115+
&.change-ins .old,
116+
&.change-del .new {
117+
cursor: not-allowed;
118+
background: $bg-color-nonexistent-block;
119+
}
120+
111121
.old {
112122
background: $bg-color-delete;
113123
}

0 commit comments

Comments
 (0)