Repository navigation
Charts: remove the theme color props and the override bridge - #51748
adamwoodnz merged 1 commit into
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Backup plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Boost plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Search plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Social plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Starter Plugin plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Protect plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Videopress plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Mu Wpcom plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Wpcomsh plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Premium Analytics plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Stats Data plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 9 files. Only the first 5 are listed here.
1 file is newly checked for coverage.
|
Codex reviewThe removed API leaves an in-repository consumer unable to type-check, while active theme color override paths and public documentation remain inconsistent with the new contract. Full review comments:
|
|
All three findings were valid. Addressed in f65b99d. P1 — Premium Analytics. Confirmed: the Type checking job was already failing on Migrated it to catalog roles. Worth noting for review: most of what that hook was passing turned out to restate the charts defaults — One deliberate behavior change: the leaderboard's delta values used P2 — color still reachable through the line-style types. Correct, and it was the same hole I did not narrow P2 — stale documentation. Fixed: the heatmap's Not from the review, but landed alongside it: the |
Codex reviewHeatmap legend text no longer honors the new CSS label role, leaving the color migration incomplete for that component. The patch also leaves several public documentation examples on removed theme APIs. Full review comments:
|
Response to round 2All three fixed in 7995c7f. P2 — Heatmap legend labels. Real bug, and the one thing in this round that a user would have seen. Verified in Storybook ( P2 — Heatmap theme guidance. Correct, though the stale text is the Theming section (233–252), not line 78 — that bullet already describes the prop and the palette role accurately. Removed the P2 — Grid-color examples. Fixed in the line-chart, bar-chart and chart-context guides: the colour moved into the CSS block as Four more of the same class that the review did not reach, found while sweeping for it: While there: six of these examples annotate a theme literal as Checks: typecheck clean, 69 suites / 1271 tests, ESLint and Stylelint clean. |
kangzj
left a comment
There was a problem hiding this comment.
Went through this one properly and gave it a spin in Storybook - reading values back with getComputedStyle rather than eyeballing, since most of what moved here is a var() chain. The mechanism holds up really well: the y axis pair does exactly what you describe, the split between the role and the theme prop is clean, and every surface I could diff against charts-262 came out the same. Nice cleanup 👍
Not approving since it's still a draft, and there's one thing I'd want sorted before it goes green anyway.
Blocker
- Premium Analytics:
--a8c-charts-color-surface-secondaryon.a8c-charts-scopealso repaints GeoChart's dataless countries, not just the funnel track it replaces. Reproduced live in the Visitors by Location story - dataless regions are#f4f4f4oncharts-262and#ecf0faon this branch, while the data ramp stays#007cba→#bedeed, so no-data now sits inside the ramp's own colour family. The PA changelog entry says "No visible change." too. Left it inline on the file.
Suggestions
Three, all inline - a docblock that got detached in leaderboard-chart.tsx, a comment that landed on the wrong role in chart-scope.scss, and the new Painted Y Axis story overflowing its container.
Testing performed
Charts Storybook on this branch, plus the same stories on charts-262 where I needed a before.
- Painted Y Axis (new story) - left chart: y axis line and y ticks both compute
none; right chart: axisrgb(56,88,233), ticksrgb(204,24,24). x axis isrgb(219,219,219)in both. ✅ - DevTools overrides -
--a8c-charts-color-grid: redon the chart's own.bar-chartturned the gridlines red straight away;--a8c-charts-color-axis-x: limeon.a8c-charts-scopemoved the x axis line and left y atnone. Both went back to#dbdbdbwhen I removed them. ✅ - themeName
mixed-color-formats- palette came out#e63946,rgb(42,157,143),rgb(250,204,20), so hex/rgb/hsl all normalise through the roles. Gridrgb(200,200,200). ✅ - themeName
custom- gridlines#ffe3e3from the role atstroke-width: 2from thethemeprop. ✅ - Pie - labels
#fff, platergba(0,0,0,0), so no visible rect. ✅ - Annotations - connector, circle subject, label anchor and label background all carry the chain and resolve (
#1e1e1e/#fff),radius: 5intact, and a per-datumstylescolour still wins (var(--jp-red)→rgb(214,54,57)). ✅ The story renders nothing while the tab is backgrounded, same as you found - the elements are in the DOM either way. - Funnel - track
#f4f4f4, bar#007cba, positive indicator#008030off the new class. ✅ - Heatmap - primary
#007cba, background#fff, legend "Less"/"More"#1e1e1eoff the new class. ✅ - Leaderboard - up
#008030, down#cc1818, and both zero-delta and the no-comparison placeholder land on neutral#707070, matching whatdeltaColorsdid.leaderboard-chartclass is on the root. ✅ - Geo (charts default) - background
#fff, dataless#f4f4f4, unchanged. ✅ - Legend labels -
#1e1e1evia.legend-item-label, and PA's own legend keeps itsfont-size: 12px. ✅ - PA parity -
--a8c-charts-color-label-background,-label-on-filland-tick-xall reach exactly what the old theme fields reached, and the.leaderboard-chartscoping keeps PA's trend colours off the funnel. The only role that widened is the one above.⚠️ - Bar Chart / Area Chart Fixed Dimensions - screenshots pixel-identical to
charts-262. ✅ (The area chart's x labels sitting over the fill is on the base branch too, so not this PR.) pnpm run test- 1271 passed, 69 suites.typecheck,build,eslint,stylelintall clean.
Nothing I could find that reads the removed props elsewhere in the monorepo - the newsletter widget's gridColorDark is on visx directly, not on charts.
Evidence
The new story, showing both the y axis roles working and the clipping I mention inline:
Geo dataless fill, same story, same data:
charts-262 |
this branch | |
|---|---|---|
| dataless region | #f4f4f4 |
#ecf0fa |
| data ramp | #007cba … #bedeed |
#007cba … #bedeed |
Thanks for the very thorough write-up on this one, it made the review a lot easier. Let me know what you think about the funnel class 🙂
| .a8c-charts-scope { | ||
| --a8c-charts-color-label-background: var(--wpds-color-background-interactive-neutral-weak); | ||
| --a8c-charts-color-label-on-fill: var(--wpds-color-foreground-interactive-neutral-strong); | ||
| --a8c-charts-color-surface-secondary: var(--wpds-color-background-surface-brand); |
There was a problem hiding this comment.
This one reaches further than the field it replaces. conversionFunnelChart.backgroundColor only ever painted the funnel track, but --a8c-charts-color-surface-secondary is also what GeoChart hands Google Charts as its dataless-region fill, so declaring it on the scope moves both.
Checked it in the Visitors by Location story: on charts-262 the dataless regions come out #f4f4f4, on this branch #ecf0fa, and the ramp is unchanged at #007cba → #bedeed. So a country with zero visitors now sits in the same pale blue family as a country with the fewest, which is a bit hard to read on the map. And the PA changelog says "No visible change.", which wouldn't be true.
I think the funnel wants the same treatment you gave the leaderboard in this PR - a stable conversion-funnel-chart class on its root, and then this line scoped to it:
.conversion-funnel-chart {
--a8c-charts-color-surface-secondary: var(--wpds-color-background-surface-brand);
}That keeps the funnel on brand and leaves the map on the neutral default. Does that make sense? Happy to be told there's a simpler way.
There was a problem hiding this comment.
You called it — our timing crossed. This landed in 5fb423c8 about two hours before your second pass, and you diffed against 660b20a, which is three commits back, so the blocker was already fixed when you re-read it.
Your suggestion is exactly what shipped, down to the SCSS:
.conversion-funnel-chart {
--a8c-charts-color-surface-secondary: var(--wpds-color-background-surface-brand);
}ConversionFunnelChart now carries a stable conversion-funnel-chart class on both root call sites (it has two — the loading branch and the normal one, and the class had to go on each). I checked the fix the way you found the bug, in Visitors by Location: geo dataless #f4f4f4 on the default → rgb(236,240,250) with the rule back on .a8c-charts-scope, reproducing your regression → #f4f4f4 again with it scoped to the funnel class. The funnel track still moves under the scoped rule, so it is doing the work and not just being inert.
Auditing for that turned up two more charts with no stable class — BarListChart had none at all (it renders through BarChartUnresponsive, so bar-chart was the only handle), and PieSemiCircleChart had one on its normal path but not its error path. Both fixed here, and both now pass a caller's own className through instead of dropping it.
Thanks for the diff — a role reaching further than the field it replaced is the failure mode this whole PR is most exposed to, and it was the one I had not checked.
| * @return Formatted string representation of the value | ||
| */ | ||
| /** Indexed by `Math.sign( delta ) + 1`, so [negative, neutral, positive]. */ | ||
| const DELTA_TREND_CLASS = [ 'deltaValue--down', 'deltaValue--neutral', 'deltaValue--up' ] as const; |
There was a problem hiding this comment.
Small one - this landed between defaultValueFormatter's docblock and the function, so the @param value / @return block now documents the constant instead of the formatter. Moving DELTA_TREND_CLASS up above the /** on line 29 puts the two back together.
There was a problem hiding this comment.
Fixed in 5fb423c8 — DELTA_TREND_CLASS moved above the /** so the @param value / @return block sits with defaultValueFormatter again. Good catch, that was a rebase artefact.
| --a8c-charts-color-axis-y: none; | ||
| --a8c-charts-color-tick-y: none; | ||
| // A role a `fill` reads needs a terminal literal even to paint nothing: a | ||
| // fallback-less var() naming an undeclared property drops the declaration, and |
There was a problem hiding this comment.
I think this comment wants to sit next to --a8c-charts-color-label-background a few lines down - that's the role where the terminal literal is actually load-bearing. Where it is now it reads as explaining --a8c-charts-color-label, which already carries its own literal and isn't the interesting case.
There was a problem hiding this comment.
Fixed in 5fb423c8 — the comment now sits above --a8c-charts-color-label-background. You were right that it was on the wrong role: --a8c-charts-color-label is read by color, which starts at currentColor, so its literal is a default rather than protection. The fill case is the load-bearing one, and label-background is where it bites — without the terminal transparent an undeclared role puts a black plate behind every pie label.
| export const PaintedYAxis: Story = { | ||
| args: { | ||
| containerWidth: '900px', | ||
| containerHeight: '340px', |
There was a problem hiding this comment.
The story overflows its container a little - I measured scrollHeight 359 against clientHeight 338, so the right chart's x tick labels get clipped off the bottom.
| containerHeight: '340px', | |
| containerHeight: '400px', |
The other half is that the right caption wraps to two lines and the left one doesn't, so the two charts start at different heights and the columns come out 380px vs 454px. Since the whole point of the story is "the x axis is identical in both", it'd read much better with repeat(2, 380px) instead of repeat(2, auto) on the grid, or a shorter caption on the right so both are one line.
There was a problem hiding this comment.
Both taken in 5fb423c8 — containerHeight: 400px, and repeat(2, 380px) on the grid. I shortened the right caption to "Axis blue, tick marks red." as well, so both captions are one line and the two charts start at the same height. The x tick labels are no longer clipped.
7995c7f to
881e34e
Compare
881e34e to
346a9c6
Compare
kangzj
left a comment
There was a problem hiding this comment.
Third time's the charm 😄 Approving — went through all 10 new commits and gave the fixes a proper spin in Storybook, and everything from my earlier passes is sorted.
The funnel fix is exactly right, and I like that bar-list-chart and the pie-semi-circle error state got the same treatment while you were there. The two extra removals (rescaleYOnLegendToggle, parseRgbString) make sense bundled into this major — I grepped the monorepo and Calypso's client/apps for both and nothing uses them.
What I checked this pass:
| Checked | Result | Status |
|---|---|---|
Delta review, 660b20a → efd73eb (10 commits) |
Fixes match the threads, comment trims stay accurate, changelog covers the new classes and removals | ✅ |
| Funnel scoping, live in Storybook | Root carries the bare conversion-funnel-chart class; track #f4f4f4 by default, follows a declaration scoped to that class, restores on removal |
✅ |
| Geo unaffected — the blocker's fix | With the same scoped rule injected, geo's resolution point stays #f4f4f4 (629 dataless paths painted #f4f4f4, ramp intact); only the old on-scope shape moves it |
✅ |
| Painted Y Axis story | No overflow (scrollHeight == clientHeight), both columns 380px, captions one line; left y axis computes none, right axis rgb(56,88,233) / ticks rgb(204,24,24) |
✅ |
| New stable classes | bar-list-chart root carries bar-list-chart + bar-chart live; both pie-semi-circle branches carry theirs |
✅ |
| Consumers of the removed APIs | None in the monorepo, none in Calypso | ✅ |
pnpm run test / typecheck (charts) |
1263 passed, 70 suites — the 11 gone are the deleted parseRgbString suite and the now-duplicate rescale test; typecheck clean |
✅ |
| CI | 88 pass; the two fails are WP 7.0 e2e env errors ("Site URL could not be resolved") on Boost and post-connection, both unrelated to charts and passing on WP latest |
The story after the height fix — x tick labels visible, both charts starting level:
Thanks for turning all of this around so quickly Adam, and sorry about the crossed wires on the last pass 🙂
ae763c9 to
cd2decb
Compare
8d0afa2 to
fa66184
Compare
fa66184 to
d8f7cc7
Compare
d8f7cc7 to
9a7f63b
Compare
Codex reviewThe intentional major-release removal of deprecated color APIs is documented, and the new CSS-role paths are consistently wired through the chart components and consumer package. |
2bc3f1e to
61186fd
Compare
Every chart color is now a `--a8c-charts-color-*` role set in CSS. The `theme` prop carries no colors, and the `--a8c-charts-*-theme` bridge that relayed them is gone, so a role declared in CSS is the only way to move a color. The catalog pointers move to `providers/chart-context/private/catalog-pointers.ts`, where they are internal rather than reachable through `defaultTheme`. Each axis gains its own pair of roles, so moving the x axis no longer moves the y. `rescaleYOnLegendToggle` and `parseRgbString`, both deprecated, are removed with them, and Premium Analytics moves its remaining overrides to `chart-roles.scss`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0147vnw9VyKQkMsknWqyXNc8
61186fd to
6881b5a
Compare
Fixes CHARTS-263
Why
After CHARTS-262 (#51687) every chart color has a
--a8c-charts-color-*role behind it, and thethemecolor props are a second way to say the same thing. Keeping both means keeping the layer that reconciles them —themeOverrideVars,withCatalogPointers, and an extra indirection on every role a field could reach. Removing the props removes the whole layer.The fields could not simply be deleted.
defaultThemewas the delivery mechanism, not a set of defaults:defaultTheme.gridStyles.strokeis literallyvar(--a8c-charts-color-grid, #dbdbdb), and that string is what lands in the gridline's inlinestyle. So the chains move first, intoprivate/catalog-pointers.ts.Read this first —
gridColorwas not deadThe issue says to delete
gridColor/gridColorDarkbecause both are''and read nowhere insrc. True of our code, false of visx:buildChartThemeseeds the y axis line and y tick marks fromconfig.gridColor, and the empty string was the only thing leaving the y axis unpainted — which is the design here.But the y axis never needed
gridColor. visx'sThemeConfighas first-classyAxisLineStyles/yTickLineStyles, symmetric with the x side. So this PR adds--a8c-charts-color-axis-yand--a8c-charts-color-tick-y, resolving tonone: same default, but the suppression is now a documented role instead of a side effect. Once the y axis has roles, the old names were a lie —--a8c-charts-color-axis/-tickonly ever painted x, so both are renamed to-axis-x/-tick-x. There is deliberately no broad--a8c-charts-color-axisabove the pair, since the two sides do not share a default.This is what keeps Calypso whole:
chart-theme.tssetsgridColor, so its dashboard charts have a painted y axis today. It gets that back by declaring the two roles — see below.Proposed changes
gridColor/gridColorDarkoff the public theme, moving the empty strings into the visx call.private/catalog-pointers.ts, point every internal reader at the constant, then delete the fields and the bridge..module.scssinstead of routing a pointer through JS into an inline style.LeaderboardChart,ConversionFunnelChartandBarListChartthe stable root class the other charts have, and add the missing one toPieSemiCircleChart's error state.BarListChartand that error state also stop dropping a caller's ownclassName.--a8c-charts-color-label-on-fillinto--a8c-charts-color-label-inverse— see Removals folded in.Why the new stable classes are needed
A role can be read by more than the chart you want to move.
--a8c-charts-color-surface-secondarypaints the funnel's track andGeoChart's dataless regions; the trend pair paints the funnel's change indicator and the leaderboard's deltas. Without a per-chart handle, a consumer setting one of those on the provider wrapper silently moves the other chart too — which is what happened to Premium Analytics' map in review (thanks @kangzj for catching it).This only works for roles the stylesheet paints. A role resolved in JS at the provider wrapper — the palette, the background — still cannot be scoped per chart. That is the limit
TOKENS.mdrecords and CHARTS-255 tracks.Two things deliberately kept
AnnotationStyleskeeps its colors as the per-datumstylesprop, andChartThemetakes a colorlessThemeAnnotationStyles.--a8c-charts-color-annotationmoves every annotation at once with no per-annotation selector to narrow it, so removing the datum colors would drop a capability with no replacement. The issue implied a blanket removal; this is narrower on purpose.CompleteChartThemestaysRequired< ChartTheme >. The acceptance criteria ask for a partial-overrides type, but the non-color defaults (tickLength, sparkline margin, heatmap sizing) are still guaranteed bydefaultThemeand readers rely on it. What goes is theOmit/Pickjuggling that existed only to keep optional color members optional.Migration
backgroundColor--a8c-charts-color-backgroundlabelBackgroundColor--a8c-charts-color-label-backgroundlabelTextColor--a8c-charts-color-label-inversecolors[ N - 1 ]--a8c-charts-color-series-N, oroptions.strokefor one seriesgridStyles.stroke--a8c-charts-color-gridxAxisLineStyles.stroke--a8c-charts-color-axis-xxTickLineStyles.stroke--a8c-charts-color-tick-xlegend.labelStyles.color--a8c-charts-color-labelsvgLabelSmall.fill--a8c-charts-color-label-axisannotationStyles.*colors--a8c-charts-color-annotation,--a8c-charts-color-surface, or the annotation's ownstylespropgeoChart.featureFillColor--a8c-charts-color-surface-secondaryleaderboardChart.primaryColor/.secondaryColorprimaryColor/secondaryColorprops, or--a8c-charts-color-series-1/-2leaderboardChart.deltaColors--a8c-charts-color-trend-down/-trend-neutral/-trend-up, scoped to.leaderboard-chartif the funnel should not followleaderboardChart.rowGap/.columnGap--a8c-charts-dimension-leaderboard-row-gap/-column-gapconversionFunnelChart.primaryColor--a8c-charts-color-series-1conversionFunnelChart.backgroundColor--a8c-charts-color-surface-secondary, scoped to.conversion-funnel-chartifGeoChartshould not followconversionFunnelChart.positiveChangeColor/.negativeChangeColor--a8c-charts-color-trend-up/-trend-downheatmapChart.primaryColorprimaryColorprop, or--a8c-charts-color-series-1gridColor--a8c-charts-color-axis-yand--a8c-charts-color-tick-y(new). Both default tononegridColorDarkxAxisLineStylesalready overrode it--a8c-charts-color-label-on-fill--a8c-charts-color-label-inverseAlso renamed:
--a8c-charts-color-axis→-axis-x,--a8c-charts-color-tick→-tick-x.An override must be set inside the provider tree, or on
.a8c-charts-scopeitself. A rule aboveGlobalChartsProviderdoes not apply: the catalog is declared on the provider's own wrapper, and an element's own declaration beats one it inherits.Removals folded in
Not in the issue, but this is the release for it. The changelog entry is already
major, and any PR merged before the next publish rides that same bump — so a separate PR only avoids a second major if nobody publishes in between, which is not something we control.AreaChart'srescaleYOnLegendTogglerescaleYOnVisibilityChange— the same setting, under a name that matches when it appliesparseRgbString()normalizeColorToHex(), which handlesrgb()alongside every other formattheme.leaderboardChart.rowGap/.columnGap--a8c-charts-color-label-on-fill--a8c-charts-color-label-inverseThe leaderboard gaps were deprecated by #51866 and never reached a release — charts is at 3.2.0, that entry is still unreleased, so 4.0.0 absorbs both. The two changelog entries are merged into one rather than shipping "deprecated" and "removed" side by side in the same version.
label-on-fillandlabel-inversewere one concept under two names — label text on a filled surface.label-inversesurvives because it is WPDS-mapped. This is the one visible change in the PR: pie labels follow--wpds-color-foreground-interactive-neutral-strongnow, so they render#f0f0f0rather than#fffuntil a consumer sets the role. Premium Analytics already overrodelabel-on-fillto exactly that token, so its dashboard is unchanged.Also gone: the "Migration from Legacy API" section in
annotation.docs.mdx, which told readers to migrate off anannotationsprop thatLineChartno longer has.smoothingis kept. One docs line called it deprecated; the types never did, and "ignored whencurveTypeis set" is an interaction rather than a replacement. That line now says what the types say.Docs and tests corrected
The docs told readers to set colors on the
themein 21 places across 15 files — a root "Core Concepts" section, nine copies of "the default theme has neutral colors", and a GeoChart API table listingbackgroundColor/datalessRegionColor/defaultColoras "Theme value". Twelve test names said the same. Both are now stated in terms of the roles and the palette.One of those tests was worse than misnamed:
use-leaderboard-legend-itemsbuilt a theme withleaderboardChart.primaryColor/.secondaryColor, passed it to the provider, and asserted only that the colors were truthy. Assigning the literal to aconstfirst suppressed excess-property checking, so nothing flagged it. The dead theme is gone and the test is named for what it checks.Calypso
client/dashboard/app/chart-theme.tssets eight fields, six of them color. Every one has a route:The last four lines are what
gridColor/gridColorDarkwere doing by accident. ThestrokeWidthfields stay on thethemeprop. Nothing is lost, but the Calypso change has to land before charts is bumped there.Premium Analytics
Migrated here, as the one in-repo consumer that set theme colors.
useChartThemekeeps only the non-color fields; the colors, the leaderboard row gap and the bar radius move to achart-roles.scssdeclaring roles on.a8c-charts-scope, with the two chart-scoped exceptions above. No visible change.Changelog
One charts entry and one Premium Analytics entry, each absorbing #51866's. No plugin entries — a departure from CHARTS-202 and CHARTS-254, which each landed ten. No plugin in the monorepo sets a charts theme color, so nothing a site owner can see changes in any of them. Say so if you disagree and I will add them.
Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
Run the charts Storybook:
pnpm -C projects/js-packages/storybook run storybook:dev.trunkexcept pie labels, which are now#f0f0f0rather than#fff. The y axis has no axis line and no tick marks, only labels.--a8c-charts-color-axis-y(blue) and--a8c-charts-color-tick-y(red). The x axis is identical in both.--a8c-charts-color-grid: redon the chart's own root (the element carrying.bar-chart) — gridlines turn red. Set--a8c-charts-color-axis-x: limeon.a8c-charts-scope— the x axis turns green, the y axis stays unpainted.--a8c-charts-color-surface-secondary: redon.a8c-charts-scopewith Geo and Conversion Funnel both open. Both move; scoping the same declaration to.conversion-funnel-chartmoves only the funnel.mixed-color-formats— the palette shows#e63946,#2a9d8f(fromrgb()),#facc14(fromhsl()), so format normalization still runs through the roles. Switch tocustom— gridlines pink (#ffe3e3, from the role) atstroke-width: 2(from thethemeprop).backgroundColor,colors,labelTextColororleaderboardChart.rowGapontheme, and still offerstickLength,gridStyles.strokeWidth,svgLabelSmall.fontFamilyandleaderboardChart.labelSpacing. NorrescaleYOnLegendToggleonAreaChart, norparseRgbStringfrom the package root.trunk— that story is what the removedrescaleYOnLegendTogglealiased.Verified
pnpm -C projects/js-packages/charts run test— 85 suites, 1389 passed.pnpm -C projects/packages/premium-analytics run test— 156 suites, 3065 passed.run typecheckon both packages,run build,eslint,stylelint— clean.run buildmatters:tools/assert-charts-scope-emitted.tsfails it if the catalog stops reachingdist/index.css, and this PR edits that stylesheet.getComputedStyle. Grid, x axis line, x tick marks and tick labels each carry thevar()chain on the element and resolve; the y pair computesnoneuntil declared, then paints, then returns tononeon removal, with x untouched throughout. Pie labels#f0f0f0, moving to#00ff00from.a8c-charts-scopeand#ff00fffrom.pie-chart. Annotations resolve withradius: 5intact. Funnel background#f4f4f4, indicator#008030. Heatmap#007cbawith the background chain resolving for thecolor-mix, and the cell fill tracking a background override at both levels. Geo#fff/#f4f4f4, both handed to Google Charts as hex. Leaderboard gaps12px/4px, following an override on.a8c-charts-scope..conversion-funnel-chartand.leaderboard-chartscoping checked the same way — the scoped override moves only its own chart, andGeoChartno longer follows.Rebase note
Rebased onto trunk after #51640 (tooltips render in-tree rather than in a
document.bodyportal) and #51722 (WPDS fallbacks injected at build time). The 33 commits were squashed to one first, so each conflict was resolved against the final state of both sides rather than against intermediate ones.chart-scope.scsslost all 23 hand-written fallbacks to the build-time plugin, andchart-scope.test.tsnow compares only the mapping, since the fallback is no longer in source.🤖 Generated with Claude Code
https://claude.ai/code/session_0147vnw9VyKQkMsknWqyXNc8