From 315ba8d72142c33568465c53e696aa5ddb581ade Mon Sep 17 00:00:00 2001 From: Do-yoon Date: Tue, 19 May 2026 12:03:47 -0700 Subject: [PATCH 1/4] feat: add light/dark theme toggle for HTML reports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #650 - Add a theme toggle button (🌙/☀️) to the navbar - Detect the OS prefers-color-scheme as the initial value - Persist the selected theme in localStorage - Set data-theme before first paint to avoid FOUC - Define light/dark palettes via CSS variables (dark uses a black base) - Override Bootstrap navbar, modals, forms, tables, DataTables pagination (Previous/Next), search input, dropdowns and scrollbars for dark mode - Applies to both the flamegraph and table reports --- src/memray/reporters/templates/base.html | 258 +++++++++++++++++++++++ 1 file changed, 258 insertions(+) diff --git a/src/memray/reporters/templates/base.html b/src/memray/reporters/templates/base.html index 39274cc6ae..60ae100169 100644 --- a/src/memray/reporters/templates/base.html +++ b/src/memray/reporters/templates/base.html @@ -7,12 +7,251 @@ memray - {{ title }} + + {%- block styles -%} {% if no_web %} {% else %} {% endif %} + {%- endblock styles -%} @@ -44,6 +283,7 @@
{% block topbar_buttons %} {% endblock topbar_buttons %} +
@@ -165,6 +405,24 @@