dynamic class selector variables
I need to define a dynamic class selector value and was hoping I could use a less variable to make this work. Unfortunately, it doesn't appear to be valid. Can anyone advise on whether I'm doing something wrong or if this simply isn't supported.
for instance, if I normally have a definition like:
.superman .fly { ...}
but I'd like for the "superman" class selctor to be dynamic, like:
@superhero .fly {...}
where "superhero is defined
as @superhero: ".superman"
. This gives compilation
errors. Any suggestions for how this could work?
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by lunelson on 09 Feb, 2012 11:16 AM
The trick might be this, or would seem to be, given the documentation at lesscss.org:
@superhero: ".superman";
@{superhero} .fly {...}