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

Whether the official statement "Selectors with variables will not match" is wrong? #4248

Open
micro-carving opened this issue Nov 30, 2023 · 1 comment
Assignees
Labels

Comments

@micro-carving
Copy link

To reproduce:

@variable: .bucket;
@{variable} { // interpolated selector
  color: blue;
}
.some-class:extend(.bucket) {} // does nothing, no match is found

Current behavior:

.bucket,
.some-class {
  color: blue;
}

image

image

Expected behavior:

.bucket {
  color: blue;
}

Environment information:

  • less version: v4.2.0
  • nodejs version: 12.22.12
  • operating system: win10
@micro-carving
Copy link
Author

Added:

The following is the description of the official document:

extend-feature-selector-interpolation-with-extend

However, :extend attached to an interpolated selector works:

.bucket {
  color: blue;
}
@{variable}:extend(.bucket) {}
@variable: .selector;

compiles to:

.bucket, .selector {
  color: blue;
}

Done!

Using the same environment, the results are as follows:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants