Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend dynamically generated selectors (summary). #2200

Closed
seven-phases-max opened this issue Sep 18, 2014 · 16 comments
Closed

Extend dynamically generated selectors (summary). #2200

seven-phases-max opened this issue Sep 18, 2014 · 16 comments

Comments

@seven-phases-max
Copy link
Member

seven-phases-max commented Sep 18, 2014

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.

@seven-phases-max
Copy link
Member Author

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).

@awcross
Copy link

awcross commented Sep 16, 2015

+1

@Pestov
Copy link

Pestov commented Nov 1, 2015

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

@pcwinters
Copy link

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

@zephraph
Copy link

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

@seven-phases-max
Copy link
Member Author

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

@zephraph
Copy link

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?

@seven-phases-max
Copy link
Member Author

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).

@zephraph
Copy link

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

@matthew-dean
Copy link
Member

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

@seven-phases-max
Copy link
Member Author

seven-phases-max commented May 5, 2016

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

Indeed. Hello copy-paste. Fixed now.

@zxcabs
Copy link

zxcabs commented Feb 14, 2017

🆙

@DennisJohnsen
Copy link

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

@guillaume-duchemin
Copy link

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

@matthew-dean
Copy link
Member

@guillaume-duchemin @seven-phases-max

#1 in the example now works as of the current release, #2 does not. You can see them here: http://lesscss.org/less-preview/

@matthew-dean
Copy link
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
Projects
None yet
Development

No branches or pull requests

10 participants