Skip to content

fix(tab-button): dark palette focused background color#31050

Open
gnbm wants to merge 11 commits intomainfrom
FW-6293
Open

fix(tab-button): dark palette focused background color#31050
gnbm wants to merge 11 commits intomainfrom
FW-6293

Conversation

@gnbm
Copy link
Copy Markdown
Contributor

@gnbm gnbm commented Mar 30, 2026

Issue number: resolves resolves internal


What is the current behavior?

In the dark palette, the --ion-tab-bar-background-focused CSS token was not defined.
When a ion-tab-button receives focus, the ::after overlay on .button-native falls back to get-color-shade(#fff)#e0e0e0 — a light grey that blends into the dark background and makes the focus indicator invisible.

What is the new behavior?

  • --ion-tab-bar-background-focused is now defined in the dark palette: #252525 for iOS and #353535 for MD , providing a dark-appropriate focus indicator.
    The same token is added to high-contrast-dark.scss with the same values.
  • A screenshot e2e test is added under tab-button/test/states/ (where the existing focused-state tests live) using configs({ palettes: ['dark'] }) and page.setContent() with class="ion-focused" applied directly, matching the established pattern for focus-state testing in this component.

Does this introduce a breaking change?

  • Yes
  • No

Other information

The test triggers keyboard mode (required by focus-visible.ts) before focusing the inner <a> element inside the tab button's shadow DOM, since calling .focus() on the host element is a no-op without delegatesFocus.

@gnbm gnbm added package: core @ionic/core package type: bug a confirmed bug report labels Mar 30, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ionic-framework Ready Ready Preview, Comment Apr 1, 2026 6:08pm

Request Review

@gnbm gnbm marked this pull request as ready for review March 30, 2026 22:20
@gnbm gnbm requested a review from a team as a code owner March 30, 2026 22:20
@gnbm gnbm requested a review from brandyscarney March 30, 2026 22:20
@ShaneK ShaneK changed the title fix(tab-button): apply correct focused background color in dark palette fix(tab-button): dark palette focused background color Mar 31, 2026
Copy link
Copy Markdown
Member

@ShaneK ShaneK left a comment

Choose a reason for hiding this comment

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

Nice improvements! A couple of new things

Copy link
Copy Markdown
Member

@ShaneK ShaneK left a comment

Choose a reason for hiding this comment

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

Looks good to me! FWIW we typically include preview URLs in the PR description when possible. For yours, you used setContent, but there's other tests that can be used to test this interaction.

Here's yours:
https://ionic-framework-git-fw-6293-ionic1.vercel.app/src/components/tabs/test/basic?ionic:mode=ios&palette=dark

https://ionic-framework-git-fw-6293-ionic1.vercel.app/src/components/tabs/test/basic?ionic:mode=md&palette=dark

@gnbm
Copy link
Copy Markdown
Contributor Author

gnbm commented Apr 1, 2026

Copy link
Copy Markdown
Member

@brandyscarney brandyscarney left a comment

Choose a reason for hiding this comment

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

Requesting some changes to the colors chosen!

gnbm and others added 4 commits April 1, 2026 17:44
Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>
Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>
Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>
Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>
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.

You will need to regenerate these.

Copy link
Copy Markdown
Contributor Author

@gnbm gnbm Apr 1, 2026

Choose a reason for hiding this comment

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

@brandyscarney Sorry, I thought the GAs would regenerate them. Can you please recheck it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package type: bug a confirmed bug report

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants