mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-17 19:06:40 +02:00
Update clearfix mixin (#21224)
* 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)
This commit is contained in:
@@ -12,13 +12,10 @@ Easily clear `float`s by adding `.clearfix` **to the parent element**. Utilizes
|
|||||||
|
|
||||||
{% highlight scss %}
|
{% highlight scss %}
|
||||||
// Mixin itself
|
// Mixin itself
|
||||||
.clearfix() {
|
@mixin clearfix() {
|
||||||
&:before,
|
&::after {
|
||||||
&:after {
|
display: block;
|
||||||
content: " ";
|
content: "";
|
||||||
display: table;
|
|
||||||
}
|
|
||||||
&:after {
|
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
@mixin clearfix() {
|
@mixin clearfix() {
|
||||||
&::after {
|
&::after {
|
||||||
|
display: block;
|
||||||
content: "";
|
content: "";
|
||||||
display: table;
|
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user