Skip to content

bug: :host selector on element combined with rtl mixins does not create the proper selector #25285

Closed
@crazyserver

Description

@crazyserver

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

With the following CSS:

:host .element-selector {
    @include position(0, 0, null, null);
}

When using the rtl mixin so, also add-root-selector it translates the selector as:

:host-context([dir=rtl])

So part of it is lost.

Expected Behavior

With the following CSS:

:host .element-selector {
@include position(0, 0, null, null);
}

When using the rtl mixin so, also add-root-selector it translates the selector as:

:host-context([dir=rtl]) .element-selector

Maintaining the whole selector.

Steps to Reproduce

  1. Create a blank template
  2. Add a div.test-element to the HTML
  3. Add the following code to the related CSS:
:host .test-element {
    @include position(0, 0, null, null);
}
  1. Run the app, inspect code of the created div and check css is not included on the element.
  2. You can also check the resulting selector is not correct on the generated css.

Code Reproduction URL

No response

Ionic Info

Ionic:

Ionic CLI : 6.19.0 (/Users/pau/.nvm/versions/node/v16.14.2/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.9.2
@angular-devkit/build-angular : 0.1000.8
@angular-devkit/schematics : 10.0.8
@angular/cli : 10.0.8
@ionic/angular-toolkit : 2.3.3

Cordova:

Cordova CLI : 11.0.0
Cordova Platforms : android 10.1.1, ios 6.2.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, (and 22 other plugins)

Utility:

cordova-res (update available: 0.15.4) : 0.15.3
native-run (update available: 1.5.0) : 1.4.0

System:

ios-sim : 8.0.2
NodeJS : v16.14.2 (/Users/pau/.nvm/versions/node/v16.14.2/bin/node)
npm : 8.5.0
OS : macOS Monterey
Xcode : Xcode 13.3 Build version 13E113

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions