]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Update clearfix mixin (#21224)
authorMark Otto <markd.otto@gmail.com>
Mon, 28 Nov 2016 01:05:29 +0000 (17:05 -0800)
committerGitHub <noreply@github.com>
Mon, 28 Nov 2016 01:05:29 +0000 (17:05 -0800)
* Update clearfix to use block instead of table display (also reorder properties for linting)
* update docs snippet for clearfix mixin—was apparently still using Less syntax and had old clearfix hack (even before the block change in this PR)

docs/utilities/clearfix.md
scss/mixins/_clearfix.scss

index a023a79aaf50fe7092356c1bd31bd1f01d179af6..49410df0988305254f8eb04dcc9f6cb77061c1e7 100644 (file)
@@ -12,13 +12,10 @@ Easily clear `float`s by adding `.clearfix` **to the parent element**. Utilizes
 
 {% highlight scss %}
 // Mixin itself
-.clearfix() {
-  &:before,
-  &:after {
-    content: " ";
-    display: table;
-  }
-  &:after {
+@mixin clearfix() {
+  &::after {
+    display: block;
+    content: "";
     clear: both;
   }
 }
index d0ae125f3d46a618f031df27a2db57ffe9f778d3..b72cf27128aaf88939ffdc18d1a8ab643b3c8f3f 100644 (file)
@@ -1,7 +1,7 @@
 @mixin clearfix() {
   &::after {
+    display: block;
     content: "";
-    display: table;
     clear: both;
   }
 }