From: Ninette Adhikari <ninette@thehoodiefirm.com>
To: openembedded-core@lists.openembedded.org
Cc: richard.purdie@linuxfoundation.org, randy.macleod@windriver.com,
engineering@neighbourhood.ie,
Ninette Adhikari <ninette@thehoodiefirm.com>
Subject: [PATCH v2 5/5] oe-build-perf-report: Add dark mode
Date: Fri, 3 May 2024 16:43:40 +0200 [thread overview]
Message-ID: <20240503144340.27385-6-ninette@thehoodiefirm.com> (raw)
In-Reply-To: <20240503144340.27385-1-ninette@thehoodiefirm.com>
Update css to add dark mode when window prefers-color-scheme is dark.
Signed-off-by: Ninette Adhikari <ninette@thehoodiefirm.com>
---
.../build_perf/html/measurement_chart.html | 15 +++++---
scripts/lib/build_perf/html/report.html | 34 +++++++++++++++----
2 files changed, 39 insertions(+), 10 deletions(-)
diff --git a/scripts/lib/build_perf/html/measurement_chart.html b/scripts/lib/build_perf/html/measurement_chart.html
index 7982ec39c2..ad4a93ed02 100644
--- a/scripts/lib/build_perf/html/measurement_chart.html
+++ b/scripts/lib/build_perf/html/measurement_chart.html
@@ -81,13 +81,20 @@
// Draw chart
const chart_div = document.getElementById('{{ chart_elem_id }}');
- const measurement_chart= echarts.init(chart_div, null, {
- height: 320
- });
+ // Set dark mode
+ let measurement_chart
+ if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
+ measurement_chart= echarts.init(chart_div, 'dark', {
+ height: 320
+ });
+ } else {
+ measurement_chart= echarts.init(chart_div, null, {
+ height: 320
+ });
+ }
// Change chart size with browser resize
window.addEventListener('resize', function() {
measurement_chart.resize();
});
measurement_chart.setOption(option);
</script>
-
diff --git a/scripts/lib/build_perf/html/report.html b/scripts/lib/build_perf/html/report.html
index 4cd240760a..537ed3ee52 100644
--- a/scripts/lib/build_perf/html/report.html
+++ b/scripts/lib/build_perf/html/report.html
@@ -19,6 +19,15 @@
{# Styles #}
<style>
+:root {
+ --text: #000;
+ --bg: #fff;
+ --h2heading: #707070;
+ --link: #0000EE;
+ --trtopborder: #9ca3af;
+ --trborder: #e5e7eb;
+ --chartborder: #f0f0f0;
+ }
.meta-table {
font-size: 14px;
text-align: left;
@@ -31,7 +40,7 @@
}
.measurement {
padding: 8px 0px 8px 8px;
- border: 2px solid #f0f0f0;
+ border: 2px solid var(--chartborder);
margin: 1.5rem 0;
}
.details {
@@ -61,6 +70,8 @@
body {
font-family: 'Helvetica', sans-serif;
margin: 3rem 8rem;
+ background-color: var(--bg);
+ color: var(--text);
}
h1 {
text-align: center;
@@ -68,13 +79,13 @@ h1 {
h2 {
font-size: 1.5rem;
margin-bottom: 0px;
- color: #707070;
+ color: var(--h2heading);
padding-top: 1.5rem;
}
h3 {
font-size: 1.3rem;
margin: 0px;
- color: #707070;
+ color: var(--h2heading);
padding: 1.5rem 0;
}
h4 {
@@ -89,10 +100,10 @@ table {
line-height: 2rem;
}
tr {
- border-bottom: 1px solid #e5e7eb;
+ border-bottom: 1px solid var(--trborder);
}
tr:first-child {
- border-bottom: 1px solid #9ca3af;
+ border-bottom: 1px solid var(--trtopborder);
}
tr:last-child {
border-bottom: none;
@@ -100,11 +111,22 @@ tr:last-child {
a {
text-decoration: none;
font-weight: bold;
- color: #0000EE;
+ color: var(--link);
}
a:hover {
color: #8080ff;
}
+@media (prefers-color-scheme: dark) {
+ :root {
+ --text: #e9e8fa;
+ --bg: #0F0C28;
+ --h2heading: #B8B7CB;
+ --link: #87cefa;
+ --trtopborder: #394150;
+ --trborder: #212936;
+ --chartborder: #b1b0bf;
+ }
+}
</style>
<title>{{ title }}</title>
--
2.44.0
next prev parent reply other threads:[~2024-05-03 14:43 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-15 14:41 [PATCH 0/3] Improvements for performance test report view Ninette Adhikari
2024-04-15 14:41 ` [PATCH 1/3] oe-build-perf-report: Add apache echarts to make report interactive Ninette Adhikari
2024-04-16 16:39 ` [OE-core] " Ross Burton
2024-04-18 14:23 ` [PATCH v2] oe-build-perf-report: Update chart tooltip format Ninette Adhikari
2024-04-15 14:41 ` [PATCH 2/3] oe-build-perf-report: Display more than 300 commits and date instead of commit number Ninette Adhikari
2024-04-15 14:41 ` [PATCH 3/3] oe-build-perf-report: Improve report styling and add descriptions Ninette Adhikari
2024-04-15 14:52 ` Patchtest results for " patchtest
2024-04-16 14:49 ` [OE-core] [PATCH 0/3] Improvements for performance test report view Richard Purdie
2024-05-03 14:43 ` [PATCH v2 0/5] " Ninette Adhikari
2024-05-03 14:43 ` [PATCH v2 1/5] oe-build-perf-report: Add apache echarts to make report interactive Ninette Adhikari
2024-05-15 15:56 ` Richard Purdie
2024-05-15 16:00 ` [OE-core] " Ross Burton
2024-05-22 14:52 ` [PATCH 0/1] oe-build-perf-report: Update tooltip to include commit link Ninette Adhikari
2024-05-22 14:52 ` [PATCH 1/1] oe-build-perf-report: Add commit hash link to chart tooltip" Ninette Adhikari
2024-05-22 15:03 ` Patchtest results for " patchtest
2024-05-24 16:01 ` Richard Purdie
2024-05-22 15:16 ` [PATCH v2 1/5] oe-build-perf-report: Add apache echarts to make report interactive Ninette Adhikari
2024-05-24 16:02 ` Richard Purdie
2024-05-03 14:43 ` [PATCH v2 2/5] oe-build-perf-report: Display more than 300 commits and date instead of commit number Ninette Adhikari
2024-05-03 14:43 ` [PATCH v2 3/5] oe-build-perf-report: Improve report styling and add descriptions Ninette Adhikari
2024-05-03 14:43 ` [PATCH v2 4/5] oe-build-perf-report: Update chart tooltip and chart type Ninette Adhikari
2024-05-03 14:43 ` Ninette Adhikari [this message]
2024-05-03 17:22 ` [PATCH v2 0/5] Improvements for performance test report view Randy MacLeod
[not found] ` <17CC0A5CB7913FF6.8557@lists.openembedded.org>
2024-05-03 18:10 ` [OE-core] " Randy MacLeod
2024-05-07 14:17 ` Ninette Adhikari
2024-05-08 15:53 ` Randy MacLeod
2024-05-13 14:28 ` Ninette Adhikari
2024-05-15 12:27 ` Ross Burton
2024-04-16 20:40 ` [OE-core] [PATCH 0/3] " Randy MacLeod
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240503144340.27385-6-ninette@thehoodiefirm.com \
--to=ninette@thehoodiefirm.com \
--cc=engineering@neighbourhood.ie \
--cc=openembedded-core@lists.openembedded.org \
--cc=randy.macleod@windriver.com \
--cc=richard.purdie@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox