Skip to content

Commit

Permalink
Fix lost selector when :host is used
Browse files Browse the repository at this point in the history
Ie: :host .element-selector when using rtl was translated as :host-context([dir=rtl]) instead of :host-context([dir=rtl]) .element-selector
  • Loading branch information
crazyserver authored May 10, 2022
1 parent e3c996d commit 454eff6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/themes/ionic.functions.string.scss
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@
// If the selector contains :host it means it is targeting just the host
// element so we can change it to look for host-context
} @else if str-contains($selector, ":host") {
$list: append($list, ":host-context(#{$addHostSelector})", comma);
$shadow-element: str-replace($selector, ":host", ":host-context(#{$addHostSelector})");
$list: append($list, $shadow-element, comma);
// If the selector does not contain host at all it is either a shadow
// or normal element so append both the dir check and host-context
} @else {
Expand Down

0 comments on commit 454eff6

Please sign in to comment.