From 601fba886ff386bb8029c9a980a9bd85bd18ef24 Mon Sep 17 00:00:00 2001 From: Joseph Fusco Date: Mon, 11 Jul 2016 09:42:08 -0400 Subject: [PATCH 1/3] DRY gallery columns --- sass/media/_galleries.scss | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/sass/media/_galleries.scss b/sass/media/_galleries.scss index 14583479..154c22e7 100644 --- a/sass/media/_galleries.scss +++ b/sass/media/_galleries.scss @@ -8,39 +8,13 @@ vertical-align: top; width: 100%; - .gallery-columns-2 & { - max-width: 50%; - } - - .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%; + @for $i from 2 through 9 { + .gallery-columns-#{$i} { + max-width: ( 100% / $i ); + } } } .gallery-caption { display: block; -} \ No newline at end of file +} From e72425f1c42670c96dbe52f0b0fa369efdbf8a9a Mon Sep 17 00:00:00 2001 From: Joseph Fusco Date: Wed, 14 Jun 2017 14:18:22 -0400 Subject: [PATCH 2/3] Add comment describing loop --- sass/media/_galleries.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/sass/media/_galleries.scss b/sass/media/_galleries.scss index 154c22e7..7499e078 100644 --- a/sass/media/_galleries.scss +++ b/sass/media/_galleries.scss @@ -8,6 +8,7 @@ vertical-align: top; width: 100%; + // Loops to enumerate the classes for gallery columns. @for $i from 2 through 9 { .gallery-columns-#{$i} { max-width: ( 100% / $i ); From ef6d0a100b87cfa80c76afab17187149144a6b02 Mon Sep 17 00:00:00 2001 From: Joseph Fusco Date: Mon, 19 Jun 2017 22:39:46 -0400 Subject: [PATCH 3/3] Update style.css values to match Sass output --- style.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/style.css b/style.css index d665be7f..94e1b966 100644 --- a/style.css +++ b/style.css @@ -862,7 +862,7 @@ object { } .gallery-columns-3 .gallery-item { - max-width: 33.33%; + max-width: 33.33333%; } .gallery-columns-4 .gallery-item { @@ -874,11 +874,11 @@ object { } .gallery-columns-6 .gallery-item { - max-width: 16.66%; + max-width: 16.66667%; } .gallery-columns-7 .gallery-item { - max-width: 14.28%; + max-width: 14.28571%; } .gallery-columns-8 .gallery-item { @@ -886,7 +886,7 @@ object { } .gallery-columns-9 .gallery-item { - max-width: 11.11%; + max-width: 11.11111%; } .gallery-caption {