Skip to content

Commit c66bb5d

Browse files
chore(accordion): cleanup and delete additional screenshots to be updated
1 parent a8362a9 commit c66bb5d

File tree

7 files changed

+7
-17
lines changed

7 files changed

+7
-17
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
--padding-end: #{globals.$ion-space-400};
5757
--padding-bottom: #{globals.$ion-space-300};
5858
--padding-start: #{globals.$ion-space-400};
59+
--background-activated: #{globals.$ion-bg-neutral-subtlest-press};
5960

6061
@include globals.typography(globals.$ion-heading-h6-medium);
6162
}

core/src/components/accordion/accordion.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,6 @@ export class Accordion implements ComponentInterface {
167167
* the button has not have been rendered yet.
168168
*/
169169
raf(() => {
170-
/**
171-
* Header slot assignment can lag first paint; re-apply defaults so
172-
* `accordion-header-item` and button props are set before a11y/screenshots.
173-
*/
174-
this.setItemDefaults();
175170
/**
176171
* Set aria label on button inside of ion-item
177172
* once the inner content has been rendered.
@@ -206,6 +201,10 @@ export class Accordion implements ComponentInterface {
206201
ionItem.lines = 'full';
207202
}
208203

204+
/**
205+
* Add a class to identify this item as an accordion header
206+
* for specific styling purposes
207+
*/
209208
ionItem.classList.add('accordion-header-item');
210209
};
211210

core/src/components/accordion/test/states/accordion.e2e.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ configs({ directions: ['ltr'], modes: ['ionic-md'] }).forEach(({ config, screens
6262
config
6363
);
6464

65-
/**
66-
* Accordion headers must receive `accordion-header-item` after hydration so ionic item
67-
* styles apply (activated background). Screenshots alone won't catch a missing class.
68-
*/
6965
const firstHeaderItem = page.locator('ion-accordion').first().locator('ion-item[slot="header"]');
7066
await expect(firstHeaderItem).toHaveClass(/accordion-header-item/);
7167

core/src/components/item/item.ionic.scss

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,9 @@ slot[name="end"]::slotted(*) {
123123
--border-radius: #{globals.$ion-border-radius-400};
124124
}
125125

126-
// Accordion header (ionic theme adds `accordion-header-item` on the slotted header item)
127-
// Neutral press for `.ion-activated`. Avoid `:host-context(ion-accordion)` — unsupported
128-
// in WebKit/Firefox; the whole rule group would be ignored (see core mixins.scss).
126+
// Item in Accordion
129127
// --------------------------------------------------
130-
:host(.accordion-header-item) {
131-
--background-activated: #{globals.$ion-bg-neutral-subtlest-press};
132-
--background-activated-opacity: 1;
133-
}
134-
128+
// Ensure button element in accordion header has proper horizontal padding specifically for nested accordions
135129
:host(.accordion-header-item) .item-native {
136130
@include globals.padding-horizontal(globals.$ion-space-400);
137131
}

0 commit comments

Comments
 (0)