summaryrefslogtreecommitdiff
path: root/gui/src/components/histogram/Histogram.scss
blob: e3f46040a9ab5c3d1b1818018cc8cd201952ff5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
table {
    border-collapse: collapse;
}

:is(thead, .ratio__text) {
    opacity: 0;
    height: 0;
    width: 0;
}

tr {
    display: grid;
    gap: 0.3rem;
    grid-template-columns: 10rem 1fr min-content;
    justify-content: start;
}

td.name {
    text-align: right;
}

td.ratio {
    width: 10rem;
    display: grid;
    grid-template-columns: 5rem 5rem;
    grid-template-rows: 1fr;
    align-items: center;

    &::before {
        content: '';
        display: block;
        height: 100%;
        grid-row: 1 / 2;
        z-index: -1;
    }

    &:is(.ratio--save, .ratio--spend)::before {
        grid-column: 1 / 2;
        border-right: 1px dashed white;
        position: relative;
        right: -1px;
    }

    &.ratio--arrears::before {
        grid-column: 2 / 3;
        border-left: 1px dashed white;
        left: -1px;
    }
}

.ratio__bar {
    display: block;
    width: calc(3rem * var(--normal-abs-ratio) + 1px);
    height: 33%;
    background-color: var(--category-highlight-color);
    grid-row: 1 / 2;

    :is(.ratio--save, .ratio--spend) & {
        grid-column: 2 / 3;
    }

    .ratio--arrears & {
        grid-column: 1 / 2;
        position: relative;
        right: -1px;
        justify-self: end;
    }
}

td.balance {
    color: var(--category-highlight-color);
}

.ratio--arrears {
    --category-highlight-color: crimson;
}

.ratio--save {
    --category-highlight-color: white;
}

.ratio--spend {
    --category-highlight-color: dodgerblue;
}