okturtles.com icon indicating copy to clipboard operation
okturtles.com copied to clipboard

Weird scss

Open taoeffect opened this issue 9 years ago • 1 comments

A few issues here:

.clearfix { display: inline-block; }
/* start commented backslash hack \*/
* html .clearfix { height: 1%; }
.clearfix { display: block; }
/* close commented backslash hack */
.clearfix:after {
  visibility: hidden;
  display: block;
  font-size: 0;
  content: " ";
  clear: both;
  height: 0;
}
  • .clearfix is defined twice for some reason, with different values
  • Not clear what the "backslash hack" is
  • What on earth is * html .clearfix { height: 1%; } ?


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

taoeffect avatar Oct 13 '16 04:10 taoeffect

The "clearfix hack" is a way to clear floats without adding extra markup, because otherwise some browsers let floats overflow their parent div. The code in question looks like a solution that works on as many browsers as possible (e.g. including IE for Mac).

If we're only supporting IE 8 and up, looks like we can use this:

.group:after {  
  content: "";  
  display: table;  
  clear: both;  
}  

Source: https://css-tricks.com/snippets/css/clear-fix/

dotmacro avatar Aug 30 '18 02:08 dotmacro