Skip to content

Commit 55fe415

Browse files
committed
MOBILE-3039 styles: Fix text wrapping in block buttons
1 parent 509222e commit 55fe415

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

src/app/app.scss

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ ion-app.app-root {
678678
> ion-icon {
679679
color: $color-base;
680680
position: absolute;
681-
@include position(0, null, null, 16px)
681+
@include position(0, null, null, 16px);
682682
height: 100%;
683683
font-size: 24px;
684684
display: flex;
@@ -1103,3 +1103,52 @@ ion-app.platform-desktop {
11031103
}
11041104
}
11051105
}
1106+
1107+
// Fix text wrapping in block buttons.
1108+
.button-block[text-wrap] {
1109+
height: auto;
1110+
1111+
// Changed from "strict" because the size depends on child elements.
1112+
contain: content;
1113+
1114+
// Add vertical padding, we cannot rely on a fixed height + centering like in normal buttons.
1115+
.item-md & {
1116+
padding-top: .5357em;
1117+
padding-bottom: .5357em;
1118+
}
1119+
.item-md &.item-button {
1120+
padding-top: .6em;
1121+
padding-bottom: .6em;
1122+
}
1123+
.item-ios & {
1124+
padding-top: .9em;
1125+
padding-bottom: .9em;
1126+
}
1127+
.item-ios &.item-button {
1128+
padding-top: .7846em;
1129+
padding-bottom: .7846em;
1130+
}
1131+
1132+
// Keep a consistent height with normal buttons if text does not wrap.
1133+
display: flex;
1134+
flex-flow: row;
1135+
align-items: center;
1136+
&.button-md {
1137+
min-height: $button-md-height;
1138+
}
1139+
&.button-large-md {
1140+
min-height: $button-md-large-height;
1141+
}
1142+
&.button-small-md {
1143+
min-height: $button-md-small-height;
1144+
}
1145+
&.button-ios {
1146+
min-height: $button-ios-height;
1147+
}
1148+
&.button-large-ios {
1149+
min-height: $button-ios-large-height;
1150+
}
1151+
&.button-small-ios {
1152+
min-height: $button-ios-small-height;
1153+
}
1154+
}

0 commit comments

Comments
 (0)