Skip to content

Commit

Permalink
fix(theme): fix rtl mixin for ionic theme (#29977)
Browse files Browse the repository at this point in the history
Issue number: resolves internal

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

Unable to use the `rtl` mixin from the ionic theme global import:

```scss
@use "../../themes/ionic/ionic.globals.scss" as globals;

:host {
  @include globals.rtl() {
    ...
  }
}
```

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

Allows the `rtl` mixin to be accessed from the global sass import

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->
  • Loading branch information
tanner-reits authored Oct 30, 2024
1 parent a2bf1bb commit 4ddc053
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions core/src/themes/mixins.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "./functions.string" as string;

/**
* A heuristic that applies CSS to tablet
* viewports.
Expand Down Expand Up @@ -239,9 +241,9 @@
@mixin rtl() {
$root: #{&};

$rootSplit: str-split($root, ",");
$selectors: #{add-root-selector($root, "[dir=rtl]")};
$selectorsSplit: str-split($selectors, ",");
$rootSplit: string.str-split($root, ",");
$selectors: #{string.add-root-selector($root, "[dir=rtl]")};
$selectorsSplit: string.str-split($selectors, ",");

$hostContextSelectors: ();
$restSelectors: ();
Expand Down Expand Up @@ -292,7 +294,7 @@
// -- @link https://bugs.webkit.org/show_bug.cgi?id=257133

// Supported by Firefox.
@at-root #{add-root-selector($root, ":dir(rtl)", false)} {
@at-root #{string.add-root-selector($root, ":dir(rtl)", false)} {
@content;
}
}
Expand Down

0 comments on commit 4ddc053

Please sign in to comment.