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

Selector references #2056

Closed
yantakus opened this issue Jun 15, 2014 · 6 comments
Closed

Selector references #2056

yantakus opened this issue Jun 15, 2014 · 6 comments

Comments

@yantakus
Copy link

Stylus developers are reviewing a spec for selector references. This is the feature we really need in Less. Please, consider adding something similar into less. That would be great. Thank you.

@seven-phases-max
Copy link
Member

This is a duplicate #1075. Unfortunately both / and &[...] operators would be conflicting with existing syntax, e.g. CSS /deep/ and Less &[boo] (a number inside [] has no meaning currently but who knows what they will invent in CSS further?).

The proposed selector function is another feature (there's no a dedicated ticked yet though it came into view here and there a few times, e.g. #1648 (comment)) and it sounds interesting (maybe a good unlocker for #1694 use-cases...).

@yantakus
Copy link
Author

@seven-phases-max The syntax can be different, what we need is features. These are the most missing.

@seven-phases-max
Copy link
Member

@web2style And it's been discussed for a year and a half by now in #1075. That's how these things work: no agreement on syntax + no volunteers to implement -> no feature. PRs are welcome (but first we need to decide on a non-conflicting syntax).

@seven-phases-max
Copy link
Member

Closing as duplicate of #1075.

@matthew-dean
Copy link
Member

That particular discussion in #1075 sort of went of the rails trying to find consensus. What got lost in the noise was the discussion of a simple root selector (/ or \ or ^).

.foo {
  width: 10px;
  .bar,
  /.baz {
    height: 10px;
  }
}
// renders as:

.foo {
  width: 10px;
}
.foo .bar,
.baz {
  height: 10px;
}

That's come up a few times, and unlike parent selectors, I think that would be fairly non-controversial as far as implementation. (Of course, who can anticipate what's non-controversial.) On the idea level, it seems straightforward. Probably just need agreement as to syntax. Should we open it as a separate issue?

@seven-phases-max
Copy link
Member

Should we open it as a separate issue?

I guess we could since it can be implemented and be useful independently of #1075.

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

3 participants