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

variables in attribute selectors will not work as expected #633

Closed
acatl opened this issue Feb 14, 2012 · 5 comments
Closed

variables in attribute selectors will not work as expected #633

acatl opened this issue Feb 14, 2012 · 5 comments

Comments

@acatl
Copy link

acatl commented Feb 14, 2012

less:

@my-variable: "alternative";
.myClass[data-genre="@{my-variable}"] {
  /* --- */
}

output:

.myClass[data-genre="@{my-variable}"] {
  /* --- */
}

expected:

.myClass[data-genre="alternative"] {
  /* --- */
}

the variable does not get injected into the selector attribute's value. is this a known issue?, is this even posible?

thanks in advance!

@neonstalwart
Copy link
Contributor

duplicate of #298

@acatl
Copy link
Author

acatl commented Feb 14, 2012

is it a duplicate? on #298 would give an error, and on this case it just passes the actual name of the variable. from what I tested.

@neonstalwart
Copy link
Contributor

i say its a duplicate because the feature is the same feature - use a variable in a selector.

the syntax used in #298 is an example of how it's done in sass so its not surprising there's an error when you try it.

ultimately its not for me to decide if this is a duplicate but you asked if it was a known issue and that was my attempt to let you know that in my opinion its a known issue. if you look harder i think you're likely to find even older issues that request this same feature - i stopped looking once i found the first one i could see.

@acatl
Copy link
Author

acatl commented Feb 14, 2012

ahh I c thanks for explaining, just to clear things out, if you try #298 on LESS it does give an error, but I definitely see your point, lets hope this can get fixed either soon, or find a work around.

@lukeapage
Copy link
Member

This is now possible

(~".myClass[data-genre=\"@{my-variable}\"]") {
}

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

No branches or pull requests

3 participants