[PR #6909] [MERGED] Add theming to charts and hence allowing custom themes on charts #21171

Closed
opened 2026-04-14 21:55:50 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/6909
Author: @karimkodera
Created: 2/8/2026
Status: Merged
Merged: 2/17/2026
Merged by: @matt-fidd

Base: masterHead: chart-theme


📝 Commits (5)

  • 4793961 Add theming to charts and hence allowing custom themes on charts
  • 21983de Removing additional color scales for charts.
  • e6ec5e5 Merge branch 'master' into chart-theme
  • e6c0dbc Fixed return fail over value.
  • 71edfed Merge branch 'master' into chart-theme

📊 Changes

7 files changed (+71 additions, -17 deletions)

View changed files

📝 packages/desktop-client/src/components/reports/chart-theme.ts (+10 -17)
📝 packages/desktop-client/src/style/palette.ts (+11 -0)
📝 packages/desktop-client/src/style/themes/dark.ts (+11 -0)
📝 packages/desktop-client/src/style/themes/development.ts (+11 -0)
📝 packages/desktop-client/src/style/themes/light.ts (+11 -0)
📝 packages/desktop-client/src/style/themes/midnight.ts (+11 -0)
upcoming-release-notes/6909.md (+6 -0)

📄 Description

This package contains modified files that add theme-aware chart colors to Actual Budget. Charts will now automatically respond to theme changes (Light, Dark, Midnight, and custom themes). Chart use colors defined in the centralized palette system. Main chart colors are defined once in palette.ts and referenced by all themes. Chart-theme is updated use the CSS global variables to provide the color scheme to the different chart component allowing the full app to follow one theme.

How it works

  1. Palette export chart color constants
  2. Themes Theme uses color palette to provide color the style component
  3. ThemeStyle component converts these to CSS variables (e.g., --color-chartQual1)
  4. chart-theme.ts returns CSS variable references instead of hex values
  5. Charts automatically use theme-appropriate colors via CSS variable resolution

The main palette include definition for the following color shades and the main themes exports the same colors from the palette. Custom themes can modify those colors to display different chart colors.

  • Qualitative (9 colors): chartQual1 through chartQual9

Edit ** Removed below color scale because they are unused.

  • Grayscale (4 colors): chartGray1 through chartGray4
  • Heatmap (5 colors): chartHeat1 through chartHeat5
  • Warm (5 colors): chartWarm1 through chartWarm5
  • Cool (5 colors): chartCool1 through chartCool5
  • Red (5 colors): chartRed1 through chartRed5
  • Blue (5 colors): chartBlue1 through chartBlue5
  • Green (5 colors): chartGreen1 through chartGreen5

Example for testing add the below additional variables to any custom theme.

/* ============================================================================
   CHART COLORS 
   ============================================================================ */

/* Qualitative Scale - for categorical/series data (9 colors) */
--color-chartQual1: #879a39;  /* green-400 - olive green (primary) */
--color-chartQual2: #d0a215;  /* yellow-400 - gold */
--color-chartQual3: #da702c;  /* orange-400 - warm orange */
--color-chartQual4: #66800b;  /* green-600 - dark green */
--color-chartQual5: #205ea6;  /* blue-600 - blue accent */
--color-chartQual6: #c03e35;  /* red-500 - red */
--color-chartQual7: #a0af54;  /* green-300 - light olive */
--color-chartQual8: #ad8301;  /* yellow-600 - dark gold */
--color-chartQual9: #bc5215;  /* orange-600 - deep orange */

Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 27 14.81 MB → 14.81 MB (+1.19 kB) +0.01%
loot-core 1 5.86 MB 0%
api 1 4.4 MB 0%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
27 14.81 MB → 14.81 MB (+1.19 kB) +0.01%
Changeset
File Δ Size
src/style/palette.ts 📈 +288 B (+15.21%) 1.85 kB → 2.13 kB
src/style/themes/development.ts 📈 +315 B (+3.58%) 8.59 kB → 8.9 kB
src/style/themes/dark.ts 📈 +315 B (+3.57%) 8.62 kB → 8.93 kB
src/style/themes/light.ts 📈 +315 B (+3.54%) 8.68 kB → 8.99 kB
src/style/themes/midnight.ts 📈 +297 B (+3.51%) 8.25 kB → 8.54 kB
src/components/reports/chart-theme.ts 📉 -313 B (-20.00%) 1.53 kB → 1.22 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 9.52 MB → 9.52 MB (+1.19 kB) +0.01%

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 12.94 kB 0%
static/js/workbox-window.prod.es5.js 5.64 kB 0%
static/js/ca.js 178.41 kB 0%
static/js/da.js 106.62 kB 0%
static/js/de.js 180.44 kB 0%
static/js/en-GB.js 7.18 kB 0%
static/js/en.js 168.63 kB 0%
static/js/es.js 173.83 kB 0%
static/js/fr.js 179.97 kB 0%
static/js/it.js 171.44 kB 0%
static/js/nb-NO.js 157.23 kB 0%
static/js/nl.js 106.65 kB 0%
static/js/pl.js 88.64 kB 0%
static/js/pt-BR.js 154.57 kB 0%
static/js/th.js 182.35 kB 0%
static/js/uk.js 215.11 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 120.54 kB 0%
static/js/ReportRouter.js 1.15 MB 0%
static/js/narrow.js 638.75 kB 0%
static/js/TransactionList.js 106.13 kB 0%
static/js/wide.js 165.25 kB 0%
static/js/AppliedFilters.js 9.71 kB 0%
static/js/usePayeeRuleCounts.js 10.05 kB 0%
static/js/useTransactionBatchActions.js 13.23 kB 0%
static/js/FormulaEditor.js 1.04 MB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.86 MB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.CZeQyUCA.js 5.86 MB 0%

api

Total

Files count Total bundle size % Changed
1 4.4 MB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
bundle.api.js 4.4 MB 0%

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/6909 **Author:** [@karimkodera](https://github.com/karimkodera) **Created:** 2/8/2026 **Status:** ✅ Merged **Merged:** 2/17/2026 **Merged by:** [@matt-fidd](https://github.com/matt-fidd) **Base:** `master` ← **Head:** `chart-theme` --- ### 📝 Commits (5) - [`4793961`](https://github.com/actualbudget/actual/commit/4793961e066896ded80e0e242c15a4c6faceed69) Add theming to charts and hence allowing custom themes on charts - [`21983de`](https://github.com/actualbudget/actual/commit/21983dea4cc77c0b1bcd6180b039bfc23d6b2ba1) Removing additional color scales for charts. - [`e6ec5e5`](https://github.com/actualbudget/actual/commit/e6ec5e5a7da554ea9500d42ac1f6ec9fe6a9e016) Merge branch 'master' into chart-theme - [`e6c0dbc`](https://github.com/actualbudget/actual/commit/e6c0dbc75966e5b28275e6162d2de18584591a05) Fixed return fail over value. - [`71edfed`](https://github.com/actualbudget/actual/commit/71edfed1f5747d657d359796d762b089a73164cb) Merge branch 'master' into chart-theme ### 📊 Changes **7 files changed** (+71 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/reports/chart-theme.ts` (+10 -17) 📝 `packages/desktop-client/src/style/palette.ts` (+11 -0) 📝 `packages/desktop-client/src/style/themes/dark.ts` (+11 -0) 📝 `packages/desktop-client/src/style/themes/development.ts` (+11 -0) 📝 `packages/desktop-client/src/style/themes/light.ts` (+11 -0) 📝 `packages/desktop-client/src/style/themes/midnight.ts` (+11 -0) ➕ `upcoming-release-notes/6909.md` (+6 -0) </details> ### 📄 Description This package contains modified files that add theme-aware chart colors to Actual Budget. Charts will now automatically respond to theme changes (Light, Dark, Midnight, and custom themes). Chart use colors defined in the centralized palette system. Main chart colors are defined once in `palette.ts` and referenced by all themes. Chart-theme is updated use the CSS global variables to provide the color scheme to the different chart component allowing the full app to follow one theme. How it works 1. **Palette** export chart color constants 2. **Themes** Theme uses color palette to provide color the style component 3. **ThemeStyle component** converts these to CSS variables (e.g., `--color-chartQual1`) 4. **chart-theme.ts** returns CSS variable references instead of hex values 5. **Charts** automatically use theme-appropriate colors via CSS variable resolution The main palette include definition for the following color shades and the main themes exports the same colors from the palette. Custom themes can modify those colors to display different chart colors. - **Qualitative** (9 colors): `chartQual1` through `chartQual9` Edit ** Removed below color scale because they are unused. - **Grayscale** (4 colors): `chartGray1` through `chartGray4` - **Heatmap** (5 colors): `chartHeat1` through `chartHeat5` - **Warm** (5 colors): `chartWarm1` through `chartWarm5` - **Cool** (5 colors): `chartCool1` through `chartCool5` - **Red** (5 colors): `chartRed1` through `chartRed5` - **Blue** (5 colors): `chartBlue1` through `chartBlue5` - **Green** (5 colors): `chartGreen1` through `chartGreen5` Example for testing add the below additional variables to any custom theme. /* ============================================================================ CHART COLORS ============================================================================ */ /* Qualitative Scale - for categorical/series data (9 colors) */ --color-chartQual1: #879a39; /* green-400 - olive green (primary) */ --color-chartQual2: #d0a215; /* yellow-400 - gold */ --color-chartQual3: #da702c; /* orange-400 - warm orange */ --color-chartQual4: #66800b; /* green-600 - dark green */ --color-chartQual5: #205ea6; /* blue-600 - blue accent */ --color-chartQual6: #c03e35; /* red-500 - red */ --color-chartQual7: #a0af54; /* green-300 - light olive */ --color-chartQual8: #ad8301; /* yellow-600 - dark gold */ --color-chartQual9: #bc5215; /* orange-600 - deep orange */ <!--- actual-bot-sections ---> <hr /> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 27 | 14.81 MB → 14.81 MB (+1.19 kB) | +0.01% loot-core | 1 | 5.86 MB | 0% api | 1 | 4.4 MB | 0% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 27 | 14.81 MB → 14.81 MB (+1.19 kB) | +0.01% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/style/palette.ts` | 📈 +288 B (+15.21%) | 1.85 kB → 2.13 kB `src/style/themes/development.ts` | 📈 +315 B (+3.58%) | 8.59 kB → 8.9 kB `src/style/themes/dark.ts` | 📈 +315 B (+3.57%) | 8.62 kB → 8.93 kB `src/style/themes/light.ts` | 📈 +315 B (+3.54%) | 8.68 kB → 8.99 kB `src/style/themes/midnight.ts` | 📈 +297 B (+3.51%) | 8.25 kB → 8.54 kB `src/components/reports/chart-theme.ts` | 📉 -313 B (-20.00%) | 1.53 kB → 1.22 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- static/js/index.js | 9.52 MB → 9.52 MB (+1.19 kB) | +0.01% **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/indexeddb-main-thread-worker-e59fee74.js | 12.94 kB | 0% static/js/workbox-window.prod.es5.js | 5.64 kB | 0% static/js/ca.js | 178.41 kB | 0% static/js/da.js | 106.62 kB | 0% static/js/de.js | 180.44 kB | 0% static/js/en-GB.js | 7.18 kB | 0% static/js/en.js | 168.63 kB | 0% static/js/es.js | 173.83 kB | 0% static/js/fr.js | 179.97 kB | 0% static/js/it.js | 171.44 kB | 0% static/js/nb-NO.js | 157.23 kB | 0% static/js/nl.js | 106.65 kB | 0% static/js/pl.js | 88.64 kB | 0% static/js/pt-BR.js | 154.57 kB | 0% static/js/th.js | 182.35 kB | 0% static/js/uk.js | 215.11 kB | 0% static/js/resize-observer.js | 18.37 kB | 0% static/js/BackgroundImage.js | 120.54 kB | 0% static/js/ReportRouter.js | 1.15 MB | 0% static/js/narrow.js | 638.75 kB | 0% static/js/TransactionList.js | 106.13 kB | 0% static/js/wide.js | 165.25 kB | 0% static/js/AppliedFilters.js | 9.71 kB | 0% static/js/usePayeeRuleCounts.js | 10.05 kB | 0% static/js/useTransactionBatchActions.js | 13.23 kB | 0% static/js/FormulaEditor.js | 1.04 MB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.86 MB | 0% <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.CZeQyUCA.js | 5.86 MB | 0% </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 4.4 MB | 0% <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- bundle.api.js | 4.4 MB | 0% </div> </details> </details> <!--- bundlestats-action-comment key:combined end ---> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-14 21:55:50 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#21171