Skip to content

Commit 876c5b6

Browse files
tausbnasgerf
authored andcommitted
Colorize positive/negative deltas
1 parent 317e52c commit 876c5b6

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

extensions/ql-vscode/src/view/compare-performance/ComparePerformance.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function renderAbsoluteValue(x: OptionalValue) {
9393
function renderDelta(x: number) {
9494
const sign = x > 0 ? "+" : "";
9595
return (
96-
<NumberCell>
96+
<NumberCell className={x > 0 ? "bad-value" : x < 0 ? "good-value" : ""}>
9797
{sign}
9898
{formatDecimal(x)}
9999
</NumberCell>
@@ -126,6 +126,19 @@ const NameCell = styled.td``;
126126
const NumberCell = styled.td`
127127
text-align: right;
128128
width: 10em !important;
129+
130+
&.bad-value {
131+
color: var(--vscode-problemsErrorIcon-foreground);
132+
tr.expanded & {
133+
color: inherit;
134+
}
135+
}
136+
&.good-value {
137+
color: var(--vscode-problemsInfoIcon-foreground);
138+
tr.expanded & {
139+
color: inherit;
140+
}
141+
}
129142
`;
130143

131144
const AbsentNumberCell = styled.td`

0 commit comments

Comments
 (0)