Skip to content

Commit

Permalink
fixes flex child display on Android UC, maybe also other browsers:
Browse files Browse the repository at this point in the history
- Accordion icon
- Button group justify style (used by Tabs)
- checkbox/radio list: both label and icon
- form field in list: label width

Big thanks to @leakl (#12#issuecomment-169879658)
  • Loading branch information
minwe committed Apr 14, 2016
1 parent 082c00f commit 3d6bbdc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/scss/components/_accordion.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
}

.#{$accordion-prefix}-icon {
@include fixes-flexbox-for-andriod;
font-size: rem-calc(20);
color: rgba($gray-light, .45);
transform: rotate(0deg);
Expand Down
1 change: 1 addition & 0 deletions src/scss/components/_button-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@

> .#{$button-prefix},
> .#{$button-group-prefix} {
@include fixes-flexbox-for-andriod;
flex: 1;
}
}
4 changes: 3 additions & 1 deletion src/scss/components/_list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
@extend %item-field;

.#{$field-prefix}-label {
@include fixes-flexbox-for-andriod;
width: 35%;
}

Expand Down Expand Up @@ -184,6 +185,7 @@
}

.#{$field-prefix}-label {
@include fixes-flexbox-for-andriod;
flex: 1;
padding: unquote(get-side($form-padding, top) + rem-calc(1) + " " + 0);
line-height: normal;
Expand All @@ -201,7 +203,7 @@
}

&:checked + .#{$field-prefix}-icon {
display: inline-block;
display: block;
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions src/scss/helper/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,14 @@
%force-hardware-acceleration {
@include force-hardware-acceleration();
}


// Browser compatibility
// -----------------------------------------------------------------------------

// 在安卓里 flex 里的子元素一定要是 block 元素,如果用行内元素 可以用flex-inline。
// (不过flex-inline兼容也不好,所以全改成块元素就好了)
// @see https://github.com/amazeui/amazeui-touch/issues/12#issuecomment-169879658
@mixin fixes-flexbox-for-andriod {
display: block;
}

0 comments on commit 3d6bbdc

Please sign in to comment.