Add theming to charts and hence allowing custom themes on charts#6909
Add theming to charts and hence allowing custom themes on charts#6909matt-fidd merged 5 commits intoactualbudget:masterfrom
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
👋 Hello contributor! We would love to review your PR! Before we can do that, please make sure:
We do this to reduce the TOIL the core contributor team has to go through for each PR and to allow for speedy reviews and merges. For more information, please see our Contributing Guide. |
📝 WalkthroughWalkthroughReplaces explicit chart color arrays with a CSS-variable-based qualitative palette and adds nine new qualitative color tokens across the base palette and all theme files; chart-theme removes other explicit scales (including grayscale) and now references CSS variables. Adds a release note entry. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🧠 Learnings used✅ Actions performedReview triggered.
|
|
Looking at the codebase quickly, unless I'm mistaken only the qualitative colours are actually used. Maybe it's time to strip out the ones we don't use and rename qualitative to something more obvious for custom themers. |
Hi Matt, Qualitative are the ones currently used. I believe that the usage of the heat map is at least quite useful for future use cases. I am happy to remove the rest if that is ok with you. I agree that once theming is there the other palettes are useless. |
I'd rather just keep the ones in use, we shouldn't just keep bloat around in case it's useful in the future. Would you be able to strip out the unused ones and just keep the qualitative ones please? |
✅ Deploy Preview for actualbudget-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for actualbudget-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Hi Matt, Done. Please check. |
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.tsand 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
--color-chartQual1)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.
chartQual1throughchartQual9Edit ** Removed below color scale because they are unused.
chartGray1throughchartGray4chartHeat1throughchartHeat5chartWarm1throughchartWarm5chartCool1throughchartCool5chartRed1throughchartRed5chartBlue1throughchartBlue5chartGreen1throughchartGreen5Example for testing add the below additional variables to any custom theme.
Bundle Stats
View detailed bundle stats
desktop-client
Total
Changeset
src/style/palette.tssrc/style/themes/development.tssrc/style/themes/dark.tssrc/style/themes/light.tssrc/style/themes/midnight.tssrc/components/reports/chart-theme.tsView detailed bundle breakdown
Added
No assets were added
Removed
No assets were removed
Bigger
Smaller
No assets were smaller
Unchanged
loot-core
Total
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
api
Total
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