wordpress gallery-item: boucle @for

This commit is contained in:
Benjamin PONGY 2015-07-09 14:41:13 +02:00
parent 4b0153af47
commit 4029bb8d33

View file

@ -271,30 +271,12 @@ img.wp-smiley {
text-align: center; text-align: center;
vertical-align: top; vertical-align: top;
.gallery-columns-2 & { @for $i from 2 through 9 {
max-width: 50%; .gallery-columns-#{$i} & {
} $w: floor(10000/$i)/100;
.gallery-columns-3 & { max-width: unquote($w + '%');
max-width: 33.33%; }
} }
.gallery-columns-4 & {
max-width: 25%;
}
.gallery-columns-5 & {
max-width: 20%;
}
.gallery-columns-6 & {
max-width: 16.66%;
}
.gallery-columns-7 & {
max-width: 14.28%;
}
.gallery-columns-8 & {
max-width: 12.5%;
}
.gallery-columns-9 & {
max-width: 11.11%;
}
} }
.gallery-caption { .gallery-caption {