As a newcomer to LESS, I am starting by using it to streamline my stylesheets and reduce duplication. In an attempt to incorporate variables into a somewhat complex selector in less 1.2.21, I have written the following code:
@current_house_id: 97;
ul#house-family-menu li#menu-item-@current_house_id {
background: #8cb4e8 url(images/family-current.png) no-repeat 97% 50%;
}
To clarify, the original CSS would have looked like this:
ul#house-family-menu li#menu-item-97 {
background: #8cb4e8 url(images/family-current.png) no-repeat 97% 50%;
}
Upon compiling with lessc, I encounter the following error:
Syntax Error: on line 268: expected one of [ ( . # * - :: : @media @font-face , { ; got @ after: ul#house-family-menu li#menu-item-
I have attempted various escape methods as suggested in different sources, but none seem to resolve the issue. Could it be that this feature is not supported in LESS? If not, perhaps I could consider an alternative approach, such as applying the styles individually.
Any assistance would be greatly appreciated.