File tree Expand file tree Collapse file tree 2 files changed +27
-13
lines changed Expand file tree Collapse file tree 2 files changed +27
-13
lines changed Original file line number Diff line number Diff line change @@ -212,20 +212,20 @@ body {
212
212
padding : 0 16px ;
213
213
}
214
214
}
215
+ }
216
+ }
215
217
216
- .cov-covered {
217
- color : var (--covered );
218
- background-color : color-mix (in srgb, var (--covered ) 10% , transparent);
219
- }
218
+ .cov-covered {
219
+ color : var (--covered );
220
+ background-color : color-mix (in srgb, var (--covered ) 10% , transparent);
221
+ }
220
222
221
- .cov-uncovered {
222
- color : var (--uncovered );
223
- background-color : color-mix (in srgb, var (--uncovered ) 20% , transparent);
224
- }
223
+ .cov-uncovered {
224
+ color : var (--uncovered );
225
+ background-color : color-mix (in srgb, var (--uncovered ) 20% , transparent);
226
+ }
225
227
226
- .cov-mixed {
227
- color : var (--mixed );
228
- background-color : color-mix (in srgb, var (--mixed ) 10% , transparent);
229
- }
230
- }
228
+ .cov-mixed {
229
+ color : var (--mixed );
230
+ background-color : color-mix (in srgb, var (--mixed ) 10% , transparent);
231
231
}
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ function main() {
28
28
}
29
29
30
30
// setup the layout
31
+ configureLegend ( )
31
32
configureFileSelect ( )
32
33
addIncrementalButton ( )
33
34
addThemeButton ( )
@@ -42,6 +43,19 @@ function main() {
42
43
document . documentElement . style . setProperty ( 'opacity' , '1' )
43
44
}
44
45
46
+ function configureLegend ( ) {
47
+ let spans = document . querySelectorAll ( '#legend span' )
48
+ for ( let i = 0 ; i < spans . length ; i ++ ) {
49
+ if ( spans [ i ] . classList . length === 0 ) continue
50
+
51
+ if ( spans [ i ] . classList [ 0 ] === 'cov0' ) {
52
+ spans [ i ] . classList . add ( 'cov-uncovered' )
53
+ } else {
54
+ spans [ i ] . classList . add ( 'cov-covered' )
55
+ }
56
+ }
57
+ }
58
+
45
59
function addCoverageSpans ( cssSelector ) {
46
60
let spans = Array . from ( document . querySelectorAll ( `${ cssSelector } span` ) )
47
61
You can’t perform that action at this time.
0 commit comments