Skip to content

Commit cd896e6

Browse files
Merge pull request #43 from CastleCSS/develop
Develop
2 parents 07b432e + 918f625 commit cd896e6

File tree

2 files changed

+40
-32
lines changed

2 files changed

+40
-32
lines changed

sass/base/utility.scss

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,43 @@
165165
.img-right img, .img-left img, .img-center img { display: block; margin: 0 auto .6; }
166166
.img-right figcaption, .img-left figcaption, .img-center figcaption { display: block; color: Gray; font-style: italic; }
167167

168+
/* Flexbox utility classes */
169+
.flex {
170+
display: flex;
171+
}
172+
173+
.dir-row { flex-direction: row; }
174+
.dir-row-reverse { flex-direction: row-reverse; }
175+
.dir-column { flex-direction: column; }
176+
.dir-column-reverse { flex-direction: column-reverse; }
177+
178+
/* Grid wrapping */
179+
.fw-wrap { flex-wrap: wrap; }
180+
.fw-nowrap { flex-wrap: nowrap; }
181+
182+
/* Alignment */
183+
184+
/* Justify content */
185+
.jc-flex-start { justify-content: flex-start; }
186+
.jc-flex-end { justify-content: flex-end; }
187+
.jc-center { justify-content: center; }
188+
.jc-space-around { justify-content: space-around; }
189+
.jc-space-between { justify-content: space-between; }
190+
191+
/* Align items */
192+
.ai-flex-start { align-items: flex-start; }
193+
.ai-flex-end { align-items: flex-end; }
194+
.ai-center { align-items: center; }
195+
.ai-space-around { align-items: baseline; }
196+
.ai-stretch { align-items: stretch; }
197+
198+
/* Align content */
199+
.ac-flex-start { align-content: flex-start; }
200+
.ac-flex-end { align-content: flex-end; }
201+
.ac-center { align-content: center; }
202+
.ac-space-around { align-content: space-around; }
203+
.ac-space-between { align-content: space-between; }
204+
168205
@media only screen and (min-width: $b3) {
169206
.img-right { float: right; margin: .8rem 0 1.6rem 4.8rem; }
170207
.img-left { float: left; margin: .8rem 4.8rem 1.6rem 0; }

sass/layout/grid.scss

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
/* Make children of grid items equal height */
4242
&-equal-height {
43-
43+
4444
> * {
4545
display: flex;
4646

@@ -58,38 +58,9 @@
5858
display: block;
5959
}
6060

61-
62-
&.dir-row { flex-direction: row; }
63-
&.dir-row-reverse { flex-direction: row-reverse; }
64-
&.dir-column { flex-direction: column; }
65-
&.dir-column-reverse { flex-direction: column-reverse; }
66-
6761
/* Grid wrapping */
68-
&.wrap { flex-wrap: wrap; }
69-
&.nowrap { flex-wrap: nowrap; }
70-
71-
/* Alignment */
72-
73-
/* Justify content */
74-
&.jc-flex-start { justify-content: flex-start; }
75-
&.jc-flex-end { justify-content: flex-end; }
76-
&.jc-center { justify-content: center; }
77-
&.jc-space-around { justify-content: space-around; }
78-
&.jc-space-between { justify-content: space-between; }
79-
80-
/* Align items */
81-
&.ai-flex-start { align-items: flex-start; }
82-
&.ai-flex-end { align-items: flex-end; }
83-
&.ai-center { align-items: center; }
84-
&.ai-space-around { align-items: baseline; }
85-
&.ai-stretch { align-items: stretch; }
86-
87-
/* Align content */
88-
&.ac-flex-start { align-content: flex-start; }
89-
&.ac-flex-end { align-content: flex-end; }
90-
&.ac-center { align-content: center; }
91-
&.ac-space-around { align-content: space-around; }
92-
&.ac-space-between { align-content: space-between; }
62+
&.wrap { flex-wrap: wrap; }
63+
&.nowrap { flex-wrap: nowrap; }
9364

9465
/* Grid items
9566
Every direct child within .g is a grid item

0 commit comments

Comments
 (0)