Skip to content

chore: Update segmented control style for one-theme - #5116

Queued
at-susie wants to merge 2 commits into
mainfrom
dev-v3-onetheme-segmented
Queued

at-susie wants to merge 2 commits into
mainfrom
dev-v3-onetheme-segmented

Conversation

@at-susie

@at-susie at-susie commented Oct 7, 2026

Copy link
Copy Markdown
Member

Description

This PR updates the style for the segmented control component only for one-theme.

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

How has this been tested?

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 Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.70%. Comparing base (fdcc7a2) to head (a7935c4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5116   +/-   ##
=======================================
  Coverage   97.70%   97.70%           
=======================================
  Files         990      990           
  Lines       31820    31820           
  Branches    11754    11754           
=======================================
  Hits        31091    31091           
  Misses        683      683           
  Partials       46       46           

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

Comment thread src/segmented-control/segment.scss Outdated
background: $selected-background;
color: $selected-color;

@include theming.one-theme-only {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this condition and just set the width to 0 for VR? Otherwise we'll have troubles adding a shadow in the other themes if that will become necessary.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mxschll. That's fair enough and integrated your feedback. The box-shadow is now defined for all themes with the width in a custom property that defaults to 0, and One Theme sets the width.

Declare the selected segment box-shadow once for all themes and carry the
border width in a custom property that falls back to 0, so themes opt in by
setting a single value instead of wrapping the shadow in a theme condition.
gap: calc(#{seg.$segment-gap} * 2 - #{seg.$segment-divider-width});
}

@include theming.one-theme-only {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this could be merged with the above gap: definition. We can use a variable that gets set depending on whether one theme is active or not which would make it a bit more maintainable than repeating this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I've quickly looked into that, but I'm not sure if that works actually.

position: relative;
inset-inline-start: calc(-1 * #{awsui.$space-xxs});
margin-inline-end: awsui.$space-xxs;
@include theming.one-theme-only {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What changed for this to be xxxs?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many icons have inner padding within the 16×16 area. When these icons are placed in a segment with equal inline spacing, the spacing can appear uneven because the icon itself contains additional space.
A negative inset-inline-start is especially useful in VR, where segments have larger inline spacing, but the current value appears too large for One Theme.

@at-susie
at-susie added this pull request to the merge queue Oct 8, 2026
Any commits made after this event will not be merged.

This branch was successfully deployed

3 active deployments
dev-pages-react18 — a7935c4a Deployed Oct 8, 2026 by at-susie via deploy (React 18) / deploy #2633
dev-pages-react16 — a7935c4a Deployed Oct 8, 2026 by at-susie via deploy (React 16) / deploy #2633
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.

2 participants