Skip to content

feat: Add subtle background to container and expandable section - #5270

Draft
gethinwebster wants to merge 1 commit into
mainfrom
dev-v3-gethinw-container-subtle-background
Draft

gethinwebster wants to merge 1 commit into
mainfrom
dev-v3-gethinw-container-subtle-background

Conversation

@gethinwebster

Copy link
Copy Markdown
Member

Description

Adds an optional subtle background to container and to the container and stacked variants of expandable section:

<Container background="subtle" header={<Header>Related resources</Header>}>...</Container>
<ExpandableSection variant="container" background="subtle" headerText="Advanced settings">...</ExpandableSection>
  • The subtle surface is the neutral 50 reference colour in light mode and neutral 1000 in dark mode, in visual refresh and One Theme. Classic is unaffected.
  • A divider separates the header from the content, spaced like the existing footer divider. A collapsed expandable section has no divider.
  • The surface applies to everything inside the container, so nested table headers, tokens and chart markers match it instead of keeping the default container colour.
  • The default (background="default") renders exactly as today.

Related links, issue #, if available: n/a

How has this been tested?

  • New unit tests for both components (applied in visual refresh, ignored in classic and in expandable section variants that do not render a container, no attribute leaks to the DOM).
  • Unit tests for every component that renders the internal container or expandable section (table, cards, side navigation, tabs, wizard, tutorial panel).
  • New dev page container/subtle-background, added to the container screenshot suite. It covers header, footer, stacked, collapsed and expanded combinations, plus a container holding form controls, buttons, status indicators, tokens, a table and a pie chart.
  • Checked the rendered page in visual refresh and One Theme, light and dark, including axe: no violations.
  • Colour contrast: every design token was measured against the new surface. No text falls below 4.5:1 and no component border below 3:1. Seven chart palette colours drop from about 3.01:1 to 2.94:1 in light mode.
Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Adds a background prop to Container and ExpandableSection (container and stacked variants). The subtle value applies a container-subtle visual context that maps the container surface to the neutral 50 (light) and neutral 1000 (dark) reference tokens for the whole subtree, and adds a divider between the header and the content.
@codecov

codecov Bot commented Nov 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.84%. Comparing base (d25043b) to head (dad2d2c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5270   +/-   ##
=======================================
  Coverage   97.83%   97.84%           
=======================================
  Files        1008     1008           
  Lines       32590    32600   +10     
  Branches    12098    12107    +9     
=======================================
+ Hits        31886    31896   +10     
+ Misses        698      663   -35     
- Partials        6       41   +35     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch was successfully deployed

2 active deployments
dev-pages-react18 — dad2d2cf Deployed Nov 9, 2026 by gethinwebster via deploy (React 18) / deploy #3243
dev-pages-react16 — dad2d2cf Deployed Nov 9, 2026 by gethinwebster via deploy (React 16) / deploy #3243
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant