Skip to content

Commit

Permalink
fix(segment): fix border-radius logic for RTL (#11981)
Browse files Browse the repository at this point in the history
  • Loading branch information
AmitMY authored and brandyscarney committed Jun 9, 2017
1 parent 3c046b4 commit 6db8c14
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
4 changes: 0 additions & 4 deletions src/components/segment/segment.ios.scss
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,10 @@ $segment-button-ios-toolbar-icon-line-height: 2.4rem !default;

[dir="rtl"] .segment-ios .segment-button {
&:first-of-type {
@include margin-horizontal(0, null);

border-left-width: 0;
}

&:last-of-type {
@include margin-horizontal(null, 0);

border-left-width: $segment-button-ios-border-width;
}
}
Expand Down
24 changes: 10 additions & 14 deletions src/themes/ionic.mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
}
}


// SVG Background Image Mixin
// --------------------------------------------------

Expand Down Expand Up @@ -68,7 +67,6 @@
}
}


// Breakpoint Mixins
// ---------------------------------------------------------------------------------

Expand All @@ -91,7 +89,6 @@
@return if($min != 0, $min, null);
}


// Returns a blank string if smallest breakpoint, otherwise returns the name with a dash infront.
// Useful for making responsive utilities.
//
Expand Down Expand Up @@ -139,7 +136,6 @@
@return if($next, breakpoint-min($next, $breakpoints) - 1px, null);
}


// Media of at most the maximum breakpoint width. No query for the largest breakpoint.
// Makes the @content apply to the given breakpoint and narrower.
@mixin media-breakpoint-down($name, $breakpoints: $grid-breakpoints) {
Expand Down Expand Up @@ -236,7 +232,7 @@
// @param {string} $start
// @param {boolean} $content include content or use default
// ----------------------------------------------------------
@mixin property($prop, $top, $end: $top, $bottom: $top, $start: $end, $content: false) {
@mixin property($prop, $top, $end: $top, $bottom: $top, $start: $end) {
@if $top == $end and $top == $bottom and $top == $start {
@include multi-dir() {
#{$prop}: $top;
Expand All @@ -257,14 +253,10 @@
#{$prop}: $top $start $bottom $end;
}
} @else {
@if $content == true { // TODO check if @content exists instead
@content;
} @else {
@include property-horizontal($prop, $start, $end);
@include multi-dir() {
#{$prop}-top: $top;
#{$prop}-bottom: $bottom;
}
@include property-horizontal($prop, $start, $end);
@include multi-dir() {
#{$prop}-top: $top;
#{$prop}-bottom: $bottom;
}
}
}
Expand Down Expand Up @@ -346,7 +338,11 @@
// @param {string} $bottom-start
// ----------------------------------------------------------
@mixin border-radius($top-start, $top-end: $top-start, $bottom-end: $top-start, $bottom-start: $top-end) {
@include property(border-radius, $top-start, $top-end, $bottom-end, $bottom-start, true) {
@if $top-start == $top-end and $top-start == $bottom-end and $top-start == $bottom-start {
@include multi-dir() {
border-radius: $top-start;
}
} @else {
@include ltr() {
border-top-left-radius: $top-start;
border-top-right-radius: $top-end;
Expand Down

0 comments on commit 6db8c14

Please sign in to comment.