Skip to content

Extend dynamically generated selectors (summary). #2200

Closed

Description

@seven-phases-max

This ticket is to replace (mostly for the sake of clear minimal examples):
#1325
#1539
#1597

It includes two distinct sub-features that require internal selector re-parsing:


[1]. Extend interpolated selector:

@var: a;

@{var} {
  color: red;
}

b:extend(a) {}

Expected result:

a, b {
  color: red;
}

[2]. Extend concatenated selector:

a {
  &b {
    color: blue;
  }
}

c:extend(ab) {}

Expected result:

ab, c {
  color: blue;
}

Related but pretty much independent feature of using a variable as an extend argument,
i.e. :extend(@{var}), is clearly specified in #1485 and not included here.

Activity

  1. seven-phases-max commented on Sep 18, 2014

    @seven-phases-max
    MemberAuthor

    Strictly speaking [2] is not even a "dynamically generated selector" but it's almost always mentioned with [1] examples so they are merged here for more easy tracking. (Though these two sub-features don't have to be implemented simultaneously).

  2. awcross commented on Sep 16, 2015

    @awcross

    +1

  3. Pestov commented on Nov 1, 2015

    @Pestov

    When are this feature will done? It's great and very useful.

  4. pcwinters commented on Dec 9, 2015

    @pcwinters

    I can imagine that this requires fundamental changes to some internals, but it should really be higher priority. 👍

  5. just-be-dev commented on Dec 10, 2015

    @just-be-dev

    Do we have an idea of what needs to be changed to support this? I'm more than willing to help out.

  6. seven-phases-max commented on Dec 10, 2015

    @seven-phases-max
    MemberAuthor

    It's just about adding the corresponding modifications to the extend implementation.

  7. just-be-dev commented on Dec 10, 2015

    @just-be-dev

    Also, what about #1485? You mentioned it's a separate feature, but would the changes needed to make this work cover that use case as well?

  8. seven-phases-max commented on Dec 10, 2015

    @seven-phases-max
    MemberAuthor

    Honestly I'm not sure I understand the question. These are really three separate features from both usage and development perspective (neither one depends on the other and there's just a little overlapping between them from a technical point of view).

  9. just-be-dev commented on Dec 10, 2015

    @just-be-dev

    Ahh, I see. I assumed that the two issues would share the same technical solution. Thanks for clearing that up.

  10. matthew-dean commented on May 5, 2016

    @matthew-dean
    Member

    Is example 2 correctly written? I'm not sure why @var: a exists in that example.

  11. seven-phases-max commented on May 5, 2016

    @seven-phases-max
    MemberAuthor

    I'm not sure why @var: a exists in that example.

    Indeed. Hello copy-paste. Fixed now.

  12. zxcabs commented on Feb 14, 2017

    @zxcabs

    🆙

  13. DennisJohnsen commented on Aug 14, 2017

    @DennisJohnsen

    Can't wait for this feature to each LESS 3 ;)

  14. guillaume-duchemin commented on Sep 18, 2018

    @guillaume-duchemin

    Hello everyone !
    I can't find any news about this issue... Is it fixed ??

  15. matthew-dean commented on Sep 18, 2018

    @matthew-dean
    Member
  16. matthew-dean commented on Sep 18, 2018

    @matthew-dean
    Member

    Since this is partially fixed and #1597 contains the part that is not addressed, I'm going to close this and re-open #1597.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions