Skip to content

feat: Add visual variant 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

@gethinwebster gethinwebster commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Description

Adds an optional accentuated visual variant to container, and to the container and stacked variants of expandable section:

<Container visualVariant="accentuated" header={<Header>Related resources</Header>}>...</Container>
<ExpandableSection variant="container" containerVisualVariant="accentuated" headerText="Advanced settings">...</ExpandableSection>
Header Content
Light mode neutral 50 unchanged
Dark mode neutral 950 neutral 1000
  • A divider separates the header from the content, in the container border colour and width. A collapsed expandable section has no divider.
  • Each surface applies to everything inside it, so nested table headers, buttons, inputs, tokens and chart markers match the surface they sit on.
  • Visual refresh and One Theme only; classic is unaffected. The default (visualVariant="default") renders exactly as today.

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

How has this been tested?

  • New unit tests for both components: the surfaces apply in visual refresh, are ignored in classic and in expandable section variants that do not render a container, and the prop does not leak 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/visual-variant, 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 surfaces. No text falls below 4.5:1 and no component border below 3:1.
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.

@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.87%. Comparing base (ddb08ab) to head (ba6d0f8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5270   +/-   ##
=======================================
  Coverage   97.87%   97.87%           
=======================================
  Files        1016     1016           
  Lines       32887    32898   +11     
  Branches    12199    12208    +9     
=======================================
+ Hits        32187    32198   +11     
  Misses        660      660           
  Partials       40       40           

☔ 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.

@gethinwebster
gethinwebster force-pushed the dev-v3-gethinw-container-subtle-background branch from dad2d2c to 6b95d3d Compare November 19, 2026 12:14
@gethinwebster gethinwebster changed the title feat: Add subtle background to container and expandable section feat: Add visual variant to container and expandable section Nov 19, 2026
Adds visualVariant to Container and containerVisualVariant to ExpandableSection (container and stacked variants). The accentuated value gives the header its own neutral background (neutral 50 in light mode, neutral 950 in dark mode), uses neutral 1000 for the content in dark mode, and adds a divider between the header and the content. The surfaces are applied as two visual contexts so nested components follow them.

This branch was successfully deployed

3 active deployments
dev-pages-react16 — ba6d0f8a Deployed Nov 19, 2026 by gethinwebster via deploy (React 16) / deploy #3403
dev-pages-react18 — ba6d0f8a Deployed Nov 19, 2026 by gethinwebster via deploy (React 18) / deploy #3403
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