Reputation: 1315
This is what I need to achieve with CSS Less: I need define a class encapsulated in other class.
CSS
.class1{ . . .}
.class1 .class2{ . . .}
LESS
In Less I know how to define this:
.class1{&.class2{. . .}}
But this is equal to this
.class1{}
.class1.class2{}
How can I define the first CSS example with Less?
Upvotes: 0
Views: 238
Reputation: 15364
Simply leave out the &
, which references the parent selector.
.class1{
.class2{. . .}
}
Upvotes: 5