At present, a framework I work with utilises the classic clearfix:
@mixin clearfix {
zoom: 1;
&::before,
&::after {
content: '';
display: table;
}
&::after {
clear: both;
}
}
I would like to know if it's safe to drop the use of the ::before
now that IE7 is no longer supported, so that I can clearfix an element that might also require a pseudo element for decorative purposes. My proposal is to turn it into the following:
@mixin clearfix {
&::after {
clear: both;
content: '';
display: table;
}
}
As far as I'm aware this will work just as it does with the ::before
, but I wanted to make absolutely certain before making the change as this would affect literally hundreds of thousands of users if I got it wrong, and I don't want to be that guy.
Thanks in advance!