Skip to content

Support /deep/ and >>> selectors in ViewEncapsulation.Emulated #7562

Closed

Description

@tbosch

Right now, selectors after :host are not properly shimed (see #5390). Users already use this feature for theming purposes.

If we supported the /deep/ and >>> selectors, users could just replace :host ... with :host >>> ....

Semantics:

a >>> b

Will be converted into

a[ngcontent_xzy] b

I.e. the selector after >>> and /deep/ will not be shimmed.

Activity

  1. ericmartinezr commented on Mar 11, 2016

    @ericmartinezr
    Contributor

    What about this comment #6511 (comment) ?

  2. tbosch commented on Mar 11, 2016

    @tbosch
    ContributorAuthor
  3. tbosch commented on Mar 11, 2016

    @tbosch
    ContributorAuthor

    @todoubaba Not implemented yet. If you check the specs, they show that the selectors after /deep/ are still shimmed.

  4. ericmartinezr commented on Mar 11, 2016

    @ericmartinezr
    Contributor

    @tbosch sorry, but my comment was more like why support something that is/has being deprecated? See https://bugs.chromium.org/p/chromium/issues/detail?id=489954 or will angular2 have its own implementation of these selectors?

  5. added a commit that references this issue on Mar 11, 2016
    dd80467
  6. tbosch commented on Mar 11, 2016

    @tbosch
    ContributorAuthor

    @ericmartinezr Supporting /deep/ is the most logical solution for now. Once we have more resources to implements css variables and also have a good way that is fast enough, we might revisit this.

  7. zoechi commented on Mar 12, 2016

    @zoechi
    Contributor

    What's the purpose of adding /deep/ and >>>. In shadow DOM that later was supposed to replace the former but they fulfill the same purpose. If you really want to add this feature, it should IMHO be >>> and ::shadow or /deep/ and ::shadow (I think /deep/ was more in use than '>>> because these combinators were deprecated shortly after it was announced that >>> replaces /deep/ AFAIR.

  8. samvloeberghs commented on Feb 2, 2017

    @samvloeberghs
    Contributor

    Is >>> still the way to go? From what I can read from the web fundamentals, using web components, the best way to do this is using css custom properties / variables:
    https://developers.google.com/web/fundamentals/getting-started/primers/shadowdom
    I'm sensing great browser compatibility issues here, thank God I'm targetting Chromium on Electron!

  9. DzmitryShylovich commented on Feb 2, 2017

    @DzmitryShylovich
    Contributor

    angular has its own css parser.

  10. samvloeberghs commented on Feb 2, 2017

    @samvloeberghs
    Contributor

    thanks for being so clear @DzmitryShylovich.. So what's the recommendation?
    What if I use ViewEncapsulation.Native?

  11. samvloeberghs commented on Feb 2, 2017

    @samvloeberghs
    Contributor

    I managed to read that part already.. But you're totally avoiding my question and suggestion..

    What if I use ViewEncapsulation.Native?
    From what I can read from the web fundamentals, using web components, the best way to do this is using css custom properties / variables:
    https://developers.google.com/web/fundamentals/getting-started/primers/shadowdom

    Will/should the css custom properties / variables work with emulated? I'm writing a test case asap.

  12. zoechi commented on Feb 2, 2017

    @zoechi
    Contributor

    @samvloeberghs AFAIK you can use it if the browser supports it. Angular doesn't have any special support for them (like for example Polymer does)

  13. janwo commented on Feb 27, 2017

    @janwo

    What is the status now? Shall I use /deep/ in the emulated mode?

  14. zoechi commented on Feb 27, 2017

    @zoechi
    Contributor

    @janwo /deep/ and >>> work the same, just SASS doesn't like >>>, but works fine with /deep/

  15. janwo commented on Feb 27, 2017

    @janwo

    @zoechi But are there any plans against using /deep/ in angular?

  16. zoechi commented on Feb 27, 2017

    @zoechi
    Contributor

    I guess so, probably depending on where shadow DOM is heading.
    Angular emulates /deep/, therefore it's not relevant it's deprecated in Chrome. Chrome never has to deal with /deep/.

  17. aperl commented on May 9, 2017

    @aperl

    Is there a clear decision if this will be supported long term? If not then it probably ought to be removed form the documentation. https://angular.io/docs/ts/latest/guide/component-styles.html#!#special-selectors. I would rather it stuck around.

  18. zoechi commented on May 9, 2017

    @zoechi
    Contributor

    @aperl I'm pretty sure there are no plans to remove it as long as there is not good replacement, and AFAIK there currently isn't, therefore there is no reason to remove it from the docs.

  19. kuncevic commented on Jul 16, 2017

    @kuncevic
    Contributor

    b754e60 how would you workaround that after it is depreciated?

  20. ericmartinezr commented on Jul 16, 2017

    @ericmartinezr
    Contributor
  21. kuncevic commented on Jul 17, 2017

    @kuncevic
    Contributor

    @ericcarraway

    Closing this as we have no plan to remove ::ng-deep in a near future.

    didn't realize that ;) tnahks

  22. daddyschmack commented on Jul 25, 2017

    @daddyschmack
  23. angular-automatic-lock-bot commented on Sep 12, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  24. locked and limited conversation to collaborators on Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions