|
15 | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | */ |
17 | 17 |
|
| 18 | +@use "sass:list"; |
| 19 | + |
18 | 20 | /* css namespace for job element */ |
19 | 21 | $cjob: ".c-job .job rect"; |
20 | 22 |
|
21 | | - |
22 | 23 | #{$cjob} { |
23 | 24 | /* if no job status display nothing */ |
24 | 25 | fill: transparent; |
25 | 26 | stroke: transparent; |
26 | 27 | } |
27 | 28 |
|
28 | | -.c-job { |
29 | | - .job { |
30 | | - vertical-align: middle; |
31 | | - /* scale the icon to the font-size */ |
32 | | - width: 1em; |
33 | | - height: 1em; |
34 | | - } |
| 29 | +.c-job .job { |
| 30 | + /* scale the icon to the font-size */ |
| 31 | + width: 1em; |
| 32 | + height: 1em; |
35 | 33 | } |
36 | 34 |
|
37 | | -@mixin job_theme($theme) { |
38 | | - @if $theme == "default" { |
39 | | - $teal: rgb(109,213,194); |
40 | | - $blue: rgb(106,164,241); |
41 | | - $green: rgb(81,175,81); |
42 | | - $red: rgb(207,72,72); |
43 | | - $pink: rgb(190,106,192); |
44 | | - |
45 | | - #{$cjob} { |
46 | | - &.submitted { |
47 | | - fill: $teal; |
48 | | - stroke: $teal; |
49 | | - } |
50 | | - |
51 | | - &.running { |
52 | | - fill: $blue; |
53 | | - stroke: $blue; |
54 | | - } |
55 | | - |
56 | | - &.succeeded { |
57 | | - fill: $green; |
58 | | - stroke: $green; |
59 | | - } |
60 | | - |
61 | | - &.failed { |
62 | | - fill: $red; |
63 | | - stroke: $red; |
64 | | - } |
65 | | - |
66 | | - &.submit-failed { |
67 | | - fill: $pink; |
68 | | - stroke: $pink; |
69 | | - } |
70 | | - } |
71 | | - } @else if $theme == "greyscale" { |
72 | | - $light: rgb(208,208,208); |
73 | | - $medium: rgb(133,133,133); |
74 | | - $dark: rgb(0,0,0); |
75 | | - |
76 | | - #{$cjob} { |
77 | | - &.submitted { |
78 | | - fill: transparent; |
79 | | - stroke: $light; |
80 | | - } |
81 | | - |
82 | | - &.running { |
83 | | - fill: $light; |
84 | | - stroke: $light; |
85 | | - } |
86 | | - |
87 | | - &.succeeded { |
88 | | - fill: $medium; |
89 | | - stroke: $medium; |
90 | | - } |
91 | | - |
92 | | - &.failed { |
93 | | - fill: $dark; |
94 | | - stroke: $dark; |
95 | | - } |
96 | | - |
97 | | - &.submit-failed { |
98 | | - fill: transparent; |
99 | | - stroke: $dark; |
100 | | - } |
101 | | - } |
102 | | - } @else if $theme == "colour_blind" { |
103 | | - $grey: rgb(152,152,152); |
104 | | - $success: rgb(108,218,255); |
105 | | - $error: rgb(146,0,0); |
106 | | - |
107 | | - #{$cjob} { |
108 | | - &.submitted { |
109 | | - fill: transparent; |
110 | | - stroke: $grey; |
111 | | - } |
112 | | - |
113 | | - &.running { |
114 | | - fill: $grey; |
115 | | - stroke: $grey; |
116 | | - } |
117 | | - |
118 | | - &.succeeded { |
119 | | - fill: $success; |
120 | | - stroke: $success; |
121 | | - } |
122 | | - |
123 | | - &.failed { |
124 | | - fill: $error; |
125 | | - stroke: $error; |
126 | | - } |
127 | | - |
128 | | - &.submit-failed { |
129 | | - fill: transparent; |
130 | | - stroke: $error; |
131 | | - } |
132 | | - } |
133 | | - } |
| 35 | +.task-state-badge { |
| 36 | + font-size: 0.7em; |
| 37 | + height: 1.8em; |
| 38 | + min-width: 1.8em; |
| 39 | + border-radius: 1.8em; |
| 40 | + border: 2px solid; |
| 41 | + margin: 0 0.1em; |
| 42 | + line-height: normal; |
134 | 43 | } |
135 | 44 |
|
136 | | -@each $theme in "default", "greyscale", "colour_blind" { |
| 45 | +$teal: rgb(109,213,194); |
| 46 | +$blue: rgb(106,164,241); |
| 47 | +$green: rgb(81,175,81); |
| 48 | +$red: rgb(207,72,72); |
| 49 | +$pink: rgb(190,106,192); |
| 50 | + |
| 51 | +$light: rgb(208,208,208); |
| 52 | +$medium: rgb(133,133,133); |
| 53 | +$dark: rgb(0,0,0); |
| 54 | + |
| 55 | +$grey: rgb(152,152,152); |
| 56 | +$success: rgb(108,218,255); |
| 57 | +$error: rgb(146,0,0); |
| 58 | + |
| 59 | +// Mapping of job themes to job states to (fill, outline, text) colors |
| 60 | +$themes: ( |
| 61 | + "default": ( |
| 62 | + "submitted": ($teal, $teal, white), |
| 63 | + "running": ($blue, $blue, white), |
| 64 | + "succeeded": ($green, $green, white), |
| 65 | + "failed": ($red, $red, white), |
| 66 | + "submit-failed": ($pink, $pink, white), |
| 67 | + ), |
| 68 | + "greyscale": ( |
| 69 | + "submitted": (transparent, $light, black), |
| 70 | + "running": ($light, $light, black), |
| 71 | + "succeeded": ($medium, $medium, white), |
| 72 | + "failed": ($dark, $dark, white), |
| 73 | + "submit-failed": (transparent, $dark, black), |
| 74 | + ), |
| 75 | + "colour_blind": ( |
| 76 | + "submitted": (transparent, $grey, black), |
| 77 | + "running": ($grey, $grey, white), |
| 78 | + "succeeded": ($success, $success, black), |
| 79 | + "failed": ($error, $error, white), |
| 80 | + "submit-failed": (transparent, $error, black), |
| 81 | + ), |
| 82 | +); |
| 83 | + |
| 84 | +@each $theme, $state_map in $themes { |
137 | 85 | .job_theme--#{$theme} { |
138 | 86 | &, // job theme as configured by the top-level application |
139 | 87 | &.job_theme_override { |
140 | 88 | // if overridden elsewhere the new value should take priority |
141 | 89 | // (this allows us to override the theme in the user profile) |
142 | | - @include job_theme($theme); |
| 90 | + @each $state, $colors in $state_map { |
| 91 | + #{$cjob}.#{$state} { |
| 92 | + fill: list.nth($colors, 1); |
| 93 | + stroke: list.nth($colors, 2); |
| 94 | + } |
| 95 | + .task-state-badge.#{$state} { |
| 96 | + background-color: list.nth($colors, 1); |
| 97 | + border-color: list.nth($colors, 2); |
| 98 | + color: list.nth($colors, 3); |
| 99 | + } |
| 100 | + } |
143 | 101 | } |
144 | 102 | } |
145 | 103 | } |
0 commit comments