Saving selector to a variable
Open
Nobody has claimed this yet.
feature request
medium priority
needs decision
research needed
- Dominant language
- JavaScript
- Stars
- 17k
- Forks
- 3.4k
- Avg merge
- 7h 42m
- Merged PRs (30d)
- 26
Description
We have this solution:
// LESS
.selector {
@r: ~'.selector';
&--mode {
@{r}__block {
prop: value;
}
}
}
// CSS
.selector--mode .selector__block {
prop: value;
}
I propose to add a feature: writing @r: &; instead of @r: ~".selector"; to get the current selector and save it in any variable.
Examples:
// LESS
.selector {
@r: &; // .selector
}
.selector {
&__inner {
@r: &; // .selector__inner
}
}
.selector {
&--modification &__inner {
@r: &; // .selector--modification .selector__inner
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing selector and variable behavior against the LESS and CSS examples in the issue. Define completion as supporting the proposed @r: & forms for the three shown selector contexts, with tests confirming the documented results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 30/100