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,29 +271,11 @@ img.wp-smiley {
text-align: center;
vertical-align: top;
.gallery-columns-2 & {
max-width: 50%;
@for $i from 2 through 9 {
.gallery-columns-#{$i} & {
$w: floor(10000/$i)/100;
max-width: unquote($w + '%');
}
.gallery-columns-3 & {
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%;
}
}