Skip to content

Commit 34a33be

Browse files
committed
fix(segment-button): design improvements
1 parent ea89e58 commit 34a33be

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

core/src/components/segment-button/segment-button.ionic.scss

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
--indicator-height: #{globals.$ionic-border-size-025};
2222
--indicator-transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
2323
--indicator-transform: none;
24-
--padding-top: #{globals.$ionic-space-100};
24+
--padding-top: #{globals.$ionic-space-200};
2525
--padding-end: #{globals.$ionic-space-200};
26-
--padding-bottom: #{globals.$ionic-space-100};
26+
--padding-bottom: #{globals.$ionic-space-200};
2727
--padding-start: #{globals.$ionic-space-200};
2828
--transition: color 0.15s linear 0s, opacity 0.15s linear 0s;
2929

@@ -39,13 +39,6 @@
3939
}
4040

4141
.button-inner {
42-
@include globals.padding(
43-
globals.$ionic-space-100,
44-
globals.$ionic-space-0,
45-
globals.$ionic-space-100,
46-
globals.$ionic-space-0
47-
);
48-
4942
gap: globals.$ionic-space-100;
5043
}
5144

@@ -93,3 +86,22 @@
9386
// Ensures the indicator displays correctly above the border
9487
z-index: 2;
9588
}
89+
90+
// Segment Button Layout
91+
// --------------------------------------------------
92+
93+
// Segments with icons above or below the label
94+
// should have a fixed height of 64px
95+
:host(.segment-button-layout-icon-top),
96+
:host(.segment-button-layout-icon-bottom) {
97+
height: globals.$ionic-scale-1600;
98+
}
99+
100+
// Segments with icons at the start or end, or with only
101+
// icons or labels, should have a fixed height of 48px
102+
:host(.segment-button-has-label-only),
103+
:host(.segment-button-has-icon-only),
104+
:host(.segment-button-layout-icon-start),
105+
:host(.segment-button-layout-icon-end) {
106+
height: globals.$ionic-scale-1200;
107+
}

0 commit comments

Comments
 (0)