Skip to content

fix(accordion): use disabled colors for the disabled state in the ionic theme - #31697

Merged
os-davidlourenco merged 5 commits into
nextfrom
ROU-13188
Nov 5, 2026
Merged

os-davidlourenco merged 5 commits into
nextfrom
ROU-13188

Conversation

@os-davidlourenco

@os-davidlourenco os-davidlourenco commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Issue number: internal (ROU-13188)


What is the current behavior?

In the ionic theme, a disabled ion-accordion is drawn with a ::before overlay that uses the shared disabled-state() mixin, painting the state-disabled token over the whole component.

That token is white at 60% opacity in light mode but black at 60% in dark mode. In light mode the white scrim blends into the white surface and looks like a fade, but in dark mode the black scrim turns the accordion surface (#1a1d21) into roughly #0a0c0d — darker than the page behind it (#131518) — so the disabled accordion renders as a black slab.

What is the new behavior?

  • The ::before overlay is removed from the disabled accordion in accordion.ionic.scss.
  • The disabled state is now expressed with colors, matching the design spec: the background stays unchanged, the header title and the content text switch to the text-disabled token, and the toggle icon switches to the icon-disabled token.
  • The header and content colors live in accordion.ionic.scss; the toggle icon rule lives in core.ionic.scss because the icon is injected into the slotted header item (light DOM), like its existing default-state rule.
  • Verified computed colors: light #9fa5ad on a white surface, dark #505763 on the #1a1d21 surface, for title, content and icon.
  • The shared disabled-state() mixin and the other components that use it are untouched.

Does this introduce a breaking change?

  • Yes
  • No

Other information

  • Interaction is unchanged: pointer-events: none for the disabled state lives in accordion.common.scss, and the disabled e2e tests (clicks and keyboard) pass.
  • The ionic-md light screenshots for the disabled accordion states will change: accordion/test/states, accordion/test/nested, accordion-group/test/states.
  • Note when testing with the states test page: it sets color="light" on ion-content, which stays white even with dark tokens; the disabled colors themselves are unaffected by this, since they no longer depend on what is behind the accordion.

@os-davidlourenco
os-davidlourenco requested a review from a team as a code owner November 5, 2026 13:38
@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
ionic-framework Ready Ready Preview Nov 5, 2026 7:03pm UTC

Request Review

@github-actions github-actions Bot added the package: core @ionic/core package label Nov 5, 2026
@os-davidlourenco os-davidlourenco changed the title ROU-13188: Fix disabled accordion dark mode background in ionic theme fix(accordion): use opacity instead of scrim for disabled state in ionic theme Nov 5, 2026
@os-davidlourenco os-davidlourenco changed the title fix(accordion): use opacity instead of scrim for disabled state in ionic theme fix(accordion): use opacity instead of a scrim for the disabled state in the ionic theme Nov 5, 2026
…ic theme

Co-authored-by: Cursor <cursoragent@cursor.com>
@os-davidlourenco os-davidlourenco changed the title fix(accordion): use opacity instead of a scrim for the disabled state in the ionic theme fix(accordion): use disabled colors for the disabled state in the ionic theme Nov 5, 2026

@ShaneK ShaneK left a comment

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.

Generally looking good, the dark mode background is fixed! Just one thing, the disabled colors don't reach nested accordions or items in the content, so a disabled parent's children look enabled even though they can't be clicked. I left a suggestion that covers it.

Comment thread core/src/css/ionic/core.ionic.scss Resolved

@ShaneK ShaneK left a comment

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.

Thanks for the updates! Nested accordions and content items pick up the disabled colors now, and enabled ones are unchanged. Looks good 🚀

@os-davidlourenco
os-davidlourenco merged commit ae810e7 into next Nov 5, 2026
54 checks passed
@os-davidlourenco
os-davidlourenco deleted the ROU-13188 branch November 5, 2026 19:20

This branch was successfully deployed

1 active deployment
Preview — c38ba933 Deployed Nov 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants