File: cockpit-components-plot.scss

package info (click to toggle)
cockpit 239-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 67,268 kB
  • sloc: javascript: 245,474; ansic: 72,273; python: 23,634; xml: 6,155; sh: 2,919; makefile: 923; sed: 5
file content (85 lines) | stat: -rw-r--r-- 2,224 bytes parent folder | download
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
85
// Selected set of PF chart colors to optimize for full-spectrum and colorblindness
// using unique part of PF name and a hex color fallback
$plotColors: (
    blue-300   #0066cc,
    green-100  #bde2b9,
    cyan-200   #73c5c5,
    purple-100 #b2b0ea,
    gold-300   #f4c145,
    orange-300 #ec7a08,
    red-200    #a30000,
    cyan-300   #009596,
    black-500  #4d5258
);

.ct-plot {
    font-family: var(--pf-chart-global--FontFamily);

    &-border {
        stroke: var(--pf-chart-global--Fill--Color--300);
        fill: transparent;
        shape-rendering: crispEdges;
    }

    &-title {
        font-size: calc(var(--pf-chart-global--FontSize--md) * 1px);
    }

    // Placeholder string to stretch the column, set offscreen
    &-widest {
        fill: transparent;
    }

    &-axis,
    &-unit {
        font-size: calc(var(--pf-chart-global--FontSize--xs) * 1px);
        fill: var(--pf-chart-global--Fill--Color--700);
        letter-spacing: var(--pf-chart-global--letter-spacing);
    }

    &-lines,
    &-ticks {
        stroke: var(--pf-chart-global--Fill--Color--300);
        shape-rendering: crispEdges;
    }

    &-selection {
        fill: tan;
        stroke: black;
        opacity: 0.5;
        shape-rendering: crispEdges;
    }

    &-paths {
        stroke-width: var(--pf-chart-global--stroke--Width--sm);
        shape-rendering: geometricPrecision;

        > path {
            fill: var(--ct-plot-path-color);
            stroke: var(--ct-plot-path-color);
        }
    }
}

$plotColorCurrent: 0;
$plotColorTotal: 0;

// Count up total number of plot colors
@each $plotColor in $plotColors { $plotColorTotal: $plotColorTotal + 1; }

// Iterate through colors and set each graph area to a color
@each $plotColor, $plotColorBackup in $plotColors {
    $plotColorCurrent: $plotColorCurrent + 1;
    .ct-plot-paths > path:nth-last-child(#{$plotColorTotal}n + #{$plotColorCurrent}) {
        --ct-plot-path-color: var(--pf-chart-color-#{$plotColor}, #{$plotColorBackup});
    }
}

// Make plot colors available to the entire page
:root {
    --ct-plot-color-total: #{$plotColorTotal};

    @for $i from 1 through $plotColorTotal {
        --ct-plot-color-#{i}: #{$plotColors[$i]};
    }
}