I have a few Less utilities that I've used as extends - here's a typical scenario.
.clearfix
{
&:before,
&:after {
content:"";
display:table;
}
&:after {
clear:both;
}
}
However, I now find myself using media queries and the extend doesn't, well, extend, to all these scenarios.
What I would like to do is to declare the code once and reuse it. I came up with this pattern which works and allows me to use the utility inside media queries, or wherever it suits.
The question is I am doing it wrong, and the extend should work inside a media query, or is there a better of tackling this.
.clearfix
{
@clearfix();
}
@clearfix :
{
&:before,
&:after {
content:"";
display:table;
}
&:after {
clear:both;
}
};
Thanks in advance.