Colorize positive/negative deltas

This commit is contained in:
Taus
2024-11-14 13:19:28 +00:00
committed by Asger F
parent 317e52c0e7
commit 876c5b6091

View File

@@ -93,7 +93,7 @@ function renderAbsoluteValue(x: OptionalValue) {
function renderDelta(x: number) {
const sign = x > 0 ? "+" : "";
return (
<NumberCell>
<NumberCell className={x > 0 ? "bad-value" : x < 0 ? "good-value" : ""}>
{sign}
{formatDecimal(x)}
</NumberCell>
@@ -126,6 +126,19 @@ const NameCell = styled.td``;
const NumberCell = styled.td`
text-align: right;
width: 10em !important;
&.bad-value {
color: var(--vscode-problemsErrorIcon-foreground);
tr.expanded & {
color: inherit;
}
}
&.good-value {
color: var(--vscode-problemsInfoIcon-foreground);
tr.expanded & {
color: inherit;
}
}
`;
const AbsentNumberCell = styled.td`