Skip to content

Commit c95f1b2

Browse files
committed
refactor(accordion): inherit border radius instead
1 parent 24b8916 commit c95f1b2

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,19 @@
1919
}
2020

2121
:host(.accordion-group-expand-inset.accordion-group-shape-round) {
22+
--border-radius: #{globals.$ion-border-radius-400};
23+
2224
@include globals.border-radius(globals.$ion-border-radius-400);
2325
}
2426

2527
:host(.accordion-group-expand-inset.accordion-group-shape-soft) {
28+
--border-radius: #{globals.$ion-border-radius-200};
29+
2630
@include globals.border-radius(globals.$ion-border-radius-200);
2731
}
2832

2933
:host(.accordion-group-expand-inset.accordion-group-shape-rectangular) {
34+
--border-radius: #{globals.$ion-border-radius-0};
35+
3036
@include globals.border-radius(globals.$ion-border-radius-0);
3137
}

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

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
// The border is removed from the item in the header because
4343
// we are adding a border to the ::after element of the accordion.
4444
::slotted(ion-item[slot="header"]) {
45-
--border-radius: #{globals.$ion-border-radius-0};
45+
--border-radius: inherit;
4646
--color: #{globals.$ion-primitives-neutral-1200};
4747
--border-width: 0;
4848
--inner-border-width: 0;
@@ -55,19 +55,6 @@
5555
@include globals.typography(globals.$ion-heading-h6-medium);
5656
}
5757

58-
// Shape only applies when inside an inset accordion group
59-
:host(.in-accordion-group-expand-inset.in-accordion-group-shape-round) ::slotted(ion-item[slot="header"]) {
60-
--border-radius: #{globals.$ion-border-radius-400};
61-
}
62-
63-
:host(.in-accordion-group-expand-inset.in-accordion-group-shape-soft) ::slotted(ion-item[slot="header"]) {
64-
--border-radius: #{globals.$ion-border-radius-200};
65-
}
66-
67-
:host(.in-accordion-group-expand-inset.in-accordion-group-shape-rectangular) ::slotted(ion-item[slot="header"]) {
68-
--border-radius: #{globals.$ion-border-radius-0};
69-
}
70-
7158
// Accordion Content
7259
// --------------------------------------------------
7360

core/src/components/accordion/accordion.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,6 @@ export class Accordion implements ComponentInterface {
444444
'accordion-animated': this.shouldAnimate(),
445445

446446
'in-accordion-group-expand-inset': hostContext('.accordion-group-expand-inset', this.el),
447-
'in-accordion-group-shape-round': hostContext('.accordion-group-shape-round', this.el),
448-
'in-accordion-group-shape-soft': hostContext('.accordion-group-shape-soft', this.el),
449-
'in-accordion-group-shape-rectangular': hostContext('.accordion-group-shape-rectangular', this.el),
450447
}}
451448
>
452449
<div

0 commit comments

Comments
 (0)