Merge pull request #986 from josephfusco/refactor-sass

Add DRY gallery columns to Sass files.

Closes #986
This commit is contained in:
David A. Kennedy 2017-06-22 18:07:57 -04:00 committed by GitHub
commit 339aa37d30
2 changed files with 10 additions and 35 deletions

View File

@ -8,39 +8,14 @@
vertical-align: top; vertical-align: top;
width: 100%; width: 100%;
.gallery-columns-2 & { // Loops to enumerate the classes for gallery columns.
max-width: 50%; @for $i from 2 through 9 {
} .gallery-columns-#{$i} {
max-width: ( 100% / $i );
.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%;
} }
} }
.gallery-caption { .gallery-caption {
display: block; display: block;
} }

View File

@ -864,7 +864,7 @@ object {
} }
.gallery-columns-3 .gallery-item { .gallery-columns-3 .gallery-item {
max-width: 33.33%; max-width: 33.33333%;
} }
.gallery-columns-4 .gallery-item { .gallery-columns-4 .gallery-item {
@ -876,11 +876,11 @@ object {
} }
.gallery-columns-6 .gallery-item { .gallery-columns-6 .gallery-item {
max-width: 16.66%; max-width: 16.66667%;
} }
.gallery-columns-7 .gallery-item { .gallery-columns-7 .gallery-item {
max-width: 14.28%; max-width: 14.28571%;
} }
.gallery-columns-8 .gallery-item { .gallery-columns-8 .gallery-item {
@ -888,7 +888,7 @@ object {
} }
.gallery-columns-9 .gallery-item { .gallery-columns-9 .gallery-item {
max-width: 11.11%; max-width: 11.11111%;
} }
.gallery-caption { .gallery-caption {