Reputation: 11330
I've recently come across the Less &:extend function.
What I would like to do is be able to nest two or more extends - in other words extend to a class that itself extends to another.
Having tested it, it seems that it either does not work, or I'm going about it the wrong way. The first extend is extended and the second nested extend isn't.
I've looked on the Less site, some authority blogs and cannot find any reference to whether or not it is possible.
Here's an example:
.clearfix
{
&:before,
&:after {
content: " ";
display: table;
}
&:after {
clear: both;
}
}
.inline-list
{
&:extend(.clearfix all);
> li {
float:left;
}
}
.test
{
&:extend(.inline-list all);
// clearfix is not extended to test
}
Any advice appreciated.
Upvotes: 0
Views: 98
Reputation: 11330
In the end I dumped dotless for ServiceStack Bundler. This gives me all the latest features of Less. IMHO I would stay clear of dotless as it is not being maintained regularly enough to be considered as an option.
Upvotes: 1
Reputation: 3142
.test{ .inline-list; }
Is that what you want, or i'm still getting it wrong?
You can easily make a class inherit from another class like this .class{ .anotherClass; .andYetAnotherClass; }
Upvotes: 0