Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Dark Mode for HTML Reports #553

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 48 additions & 0 deletions packages/istanbul-reports/lib/html/assets/base.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
:root {
color-scheme: light dark;
}

body, html {
margin:0; padding: 0;
height: 100%;
Expand Down Expand Up @@ -222,3 +226,47 @@ pre.prettyprint {
.footer, .push {
height: 48px;
}


@media (prefers-color-scheme: dark) {
body {
color:#ddd;
fishcharlie marked this conversation as resolved.
Show resolved Hide resolved
background:#222;
}
.quiet {
color: rgba(255,255,255,0.5);
}


/* yellow */
.cbranch-no { background: yellow !important; color: #111; }
/* dark red */
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
.low .chart { border:1px solid #C21F39 }
.highlighted,
.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
background: #C21F39 !important;
}
/* medium red */
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
/* light red */
.low, .cline-no { background:#FCE1E5 }
/* light green */
.high, .cline-yes { background:#36471c }
/* medium green */
.cstat-yes { background:#526d2a }
/* dark green */
.status-line.high, .high .cover-fill { background:#1d541a }
/* dark yellow (gold) */
.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
.medium .chart { border:1px solid #f9cd0b; }
/* light yellow */
.medium { background: #fff4c2; }

.cstat-skip { background: #ddd; color: #111; }
.fstat-skip { background: #ddd; color: #111 !important; }
.cbranch-skip { background: #ddd !important; color: #111; }

span.cline-neutral { background: #1c1c1c; }
}