Skip to content

Commit 65fa328

Browse files
fix(accordion): use disabled colors for the disabled state in the ionic theme
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 765ff65 commit 65fa328

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

‎core/src/components/accordion/accordion.ionic.scss‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,13 @@
7474
// Disabled Accordion
7575
// --------------------------------------------------
7676

77-
:host(.accordion-disabled)::before {
78-
@include globals.border-radius(inherit);
79-
@include globals.disabled-state();
77+
// The background stays unchanged and only the text switches to the
78+
// disabled color, matching the design spec. The toggle icon is handled
79+
// in core.ionic.scss because it lives in the item's light DOM.
80+
:host(.accordion-disabled) ::slotted(ion-item[slot="header"]) {
81+
--color: #{globals.$ion-text-disabled};
82+
}
8083

81-
z-index: 2;
84+
:host(.accordion-disabled) #content-wrapper {
85+
color: globals.$ion-text-disabled;
8286
}

‎core/src/css/ionic/core.ionic.scss‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,14 @@ ion-accordion.accordion-animated > [slot="header"] .ion-accordion-toggle-icon {
321321
transition: globals.$ion-transition-time-300 transform globals.$ion-transition-curve-quick;
322322
}
323323

324+
// The disabled accordion keeps its background and only switches the
325+
// text and icon to the disabled colors. The text is handled in
326+
// accordion.ionic.scss; the toggle icon has to be styled here because
327+
// it is injected into the slotted header item (light DOM).
328+
ion-accordion.accordion-disabled > [slot="header"] .ion-accordion-toggle-icon {
329+
color: globals.$ion-icon-disabled;
330+
}
331+
324332
@media (prefers-reduced-motion: reduce) {
325333
ion-accordion .ion-accordion-toggle-icon {
326334
/* stylelint-disable declaration-no-important */

0 commit comments

Comments
 (0)