chart: Add chart.grid theme color for grid lines - #3236
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Chart grid lines were painted in the theme's
bordercolor, the same as the axes, which reads too heavy behind the data. This adds achart.gridtheme color for grid lines only.LineChart,AreaChart,BarChart,CandlestickChartandRadarChartgrids now usechart_grid. Axes and pie leader lines stay onborder, reference lines stay onmuted_foreground, so the axis now reads one step above the grid.chart.gridtoneutral-200/60(light) andneutral-800/60(dark).chart.gridunset falls back toborderat 60% opacity, so third-party themes get the lighter grid too. It is translucent rather than blended withbackground, so it sits right on cards and other surfaces..theme-schema.json, the Theme story color list and the Chart docs (en / zh-CN) include the new key.Public API
gpui-component
ThemeColor::chart_grid: Hsla— chart grid line color, read fromchart.gridin the theme file.chart.grid— optional; falls back toborderat 60% opacity.How to Test
cargo run -- chartand compare the grids in light and dark mode, includinggrid_columnsand the radar chart.cargo test -p gpui-component --lib theme::covers both an explicitchart.gridand the fallback.Checklist
cargo runfor story tests related to the changes.