Skip to content

Commit 1801e50

Browse files
author
Roni Laukkarinen
committed
Gallery fixes, add columns based on wp-admin option
1 parent e60955d commit 1801e50

File tree

5 files changed

+169
-10
lines changed

5 files changed

+169
-10
lines changed

css/global.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/**
1111
* The current version of the theme.
1212
*/
13-
define( 'AIR_VERSION', '1.7.4' );
13+
define( 'AIR_VERSION', '1.8.0' );
1414

1515
/**
1616
* Allow Gravity Forms to hide labels to add placeholders

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "air",
3-
"version": "1.7.4",
3+
"version": "1.8.0",
44
"description": "A minimalist WordPress starter theme.",
55
"author": "Digitoimisto Dude Oy (moro@dude.fi)",
66
"devDependencies": {

sass/features/_gallery.scss

Lines changed: 165 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,169 @@
11
// WordPress galleries
22
.gallery {
33
clear: both;
4+
overflow: hidden;
5+
text-align: center;
6+
7+
&.gallery-columns-1 {
8+
.gallery-item {
9+
@include stack();
10+
}
11+
}
12+
13+
&.gallery-columns-2 {
14+
.gallery-item {
15+
@include col(1/2, $cycle: 2);
16+
17+
@media (max-width: $container-mobile) {
18+
@include stack();
19+
text-align: center;
20+
}
21+
}
22+
}
23+
24+
&.gallery-columns-3 {
25+
.gallery-item {
26+
@include col(1/3, $cycle: 3);
27+
28+
@media (max-width: $container-ipad) {
29+
@include col(1/3, $cycle: 3);
30+
}
31+
32+
@media (max-width: $container-mobile) {
33+
@include stack();
34+
text-align: center;
35+
}
36+
}
37+
}
38+
39+
&.gallery-columns-4 {
40+
.gallery-item {
41+
@include col(1/4, $cycle: 4);
42+
43+
@media (max-width: $container-ipad) {
44+
@include col(1/3, $cycle: 3);
45+
}
46+
47+
@media (max-width: $container-mobile) {
48+
@include stack();
49+
text-align: center;
50+
}
51+
}
52+
}
53+
54+
&.gallery-columns-5 {
55+
.gallery-item {
56+
@include col(1/5, $cycle: 5);
57+
58+
@media (max-width: $container-ipad) {
59+
@include col(1/3, $cycle: 3);
60+
}
61+
62+
@media (max-width: $container-mobile) {
63+
@include stack();
64+
text-align: center;
65+
}
66+
}
67+
}
68+
69+
&.gallery-columns-6 {
70+
.gallery-item {
71+
@include col(1/6, $cycle: 6);
72+
73+
@media (max-width: $container-ipad) {
74+
@include col(1/3, $cycle: 3);
75+
}
76+
77+
@media (max-width: $container-mobile) {
78+
@include stack();
79+
text-align: center;
80+
}
81+
}
82+
}
83+
84+
&.gallery-columns-7 {
85+
.gallery-item {
86+
@include col(1/7, $cycle: 7);
87+
88+
@media (max-width: $container-ipad) {
89+
@include col(1/3, $cycle: 3);
90+
}
91+
92+
@media (max-width: $container-mobile) {
93+
@include stack();
94+
text-align: center;
95+
}
96+
}
97+
}
98+
99+
&.gallery-columns-8 {
100+
.gallery-item {
101+
@include col(1/8, $cycle: 8);
102+
103+
@media (max-width: $container-ipad) {
104+
@include col(1/3, $cycle: 3);
105+
}
106+
107+
@media (max-width: $container-mobile) {
108+
@include stack();
109+
text-align: center;
110+
}
111+
}
112+
}
113+
114+
&.gallery-columns-9 {
115+
.gallery-item {
116+
@include col(1/9, $cycle: 9);
117+
118+
@media (max-width: $container-ipad) {
119+
@include col(1/3, $cycle: 3);
120+
}
121+
122+
@media (max-width: $container-mobile) {
123+
@include stack();
124+
text-align: center;
125+
}
126+
}
127+
}
128+
129+
&.gallery-columns-10 {
130+
.gallery-item {
131+
@include col(1/10, $cycle: 10);
132+
133+
@media (max-width: $container-ipad) {
134+
@include col(1/3, $cycle: 3);
135+
}
136+
137+
@media (max-width: $container-mobile) {
138+
@include stack();
139+
text-align: center;
140+
}
141+
}
142+
}
4143

5144
.gallery-item {
6-
float: left;
145+
// Default columns
146+
@include col(1/4, $cycle: 4);
147+
148+
@media (max-width: $container-ipad) {
149+
@include col(1/3, $cycle: 3);
150+
}
151+
152+
@media (max-width: $container-mobile) {
153+
@include stack();
154+
text-align: center;
155+
}
156+
157+
.gallery-caption {
158+
font-size: .85em;
159+
margin-top: .7em;
160+
font-style: italic;
161+
display: block;
162+
font-family: $font-headings;
163+
line-height: 1.2;
164+
text-align: center;
165+
opacity: .6;
166+
}
7167

8168
.gallery-icon {
9169
a {
@@ -14,12 +174,11 @@
14174
border: 0;
15175
height: auto;
16176
margin-bottom: 0;
177+
width: 100%;
178+
height: auto;
179+
max-width: 150px;
180+
max-height: 150px;
17181
}
18182
}
19-
20-
.gallery-caption {
21-
margin: 0;
22-
text-align: center;
23-
}
24183
}
25184
}

style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Theme URI: https://github.com/digitoimistodude/air
44
Author: Digitoimisto Dude Oy
55
Author URI: https://www.dude.fi
66
Description: A minimalist WordPress starter theme.
7-
Version: 1.7.4
7+
Version: 1.8.0
88
License: GNU General Public License v2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010
Text Domain: air

0 commit comments

Comments
 (0)