From 805b2258766a6554b603974a8912ba79a8060e3f Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Tue, 21 May 2019 17:46:14 -0400 Subject: [PATCH] fix(segment): update segment border for rtl (#18326) references #17012 --- .../components/segment-button/segment-button.scss | 5 +++++ core/src/themes/ionic.functions.string.scss | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/core/src/components/segment-button/segment-button.scss b/core/src/components/segment-button/segment-button.scss index 443b62bbed9..bc57bf9840b 100644 --- a/core/src/components/segment-button/segment-button.scss +++ b/core/src/components/segment-button/segment-button.scss @@ -71,6 +71,11 @@ } :host(:not(:first-of-type)) { + @include rtl() { + border-right-width: 0; + border-left-width: var(--border-width); + } + border-left-width: 0; } diff --git a/core/src/themes/ionic.functions.string.scss b/core/src/themes/ionic.functions.string.scss index fcf7b5e5140..8f1eaef5e7c 100644 --- a/core/src/themes/ionic.functions.string.scss +++ b/core/src/themes/ionic.functions.string.scss @@ -121,10 +121,16 @@ @each $element in $elements { @if str-contains($element, ":host(") { - $updated-element: str-replace($element, ")", ""); - $updated-element: str-replace($updated-element, ":host(", ":host-context(#{$addHostSelector})"); + $scoped-element: $element; - $new-element: append($new-element, $updated-element, space); + @if str-contains($element, "))") { + $scoped-element: str-replace($scoped-element, "))", ")"); + } @else { + $scoped-element: str-replace($scoped-element, ")", ""); + } + $scoped-element: str-replace($scoped-element, ":host(", ":host-context(#{$addHostSelector})"); + + $new-element: append($new-element, $scoped-element, space); } @else { $new-element: append($new-element, $element, space); }