Variable interpolation doesn't work in attribute selector after a `-`
Open
Nobody has claimed this yet.
bug
low priority
- Dominant language
- JavaScript
- Stars
- 17k
- Forks
- 3.4k
- Avg merge
- 7h 42m
- Merged PRs (30d)
- 26
Description
less:
.layout-for-name(@name) {
[layout-@{name}] {
box-sizing : border-box;
display : flex;
}
[layout-@{name}=column] {
flex-direction : column;
}
[layout-@{name}=row] {
flex-direction : row;
}
}
.layout-for-name(sm);
expected:
[layout-sm] {
box-sizing : border-box;
display : flex;
}
[layout-sm=column] {
flex-direction : column;
}
[layout-sm=row] {
flex-direction : row;
}
currently:
expected ']' got 'l' in file ...
But Variable interpolation in the attr selector without a - works
less:
.layout-for-name(@name) {
[@{name}] {
box-sizing : border-box;
display : flex;
}
[@{name}=column] {
flex-direction : column;
}
[@{name}=row] {
flex-direction : row;
}
}
.layout-for-name(sm);
output:
[sm] {
box-sizing : border-box;
display : flex;
}
[sm=column] {
flex-direction : column;
}
[sm=row] {
flex-direction : row;
}
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
No file or test is named in the report. Start by reproducing both attribute-selector examples through the Less parser, then trace handling of interpolated selectors containing a hyphen; done means the hyphenated case produces the expected selectors without regressing the working case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, javascript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100