Skip to content

Commit 5049cc5

Browse files
Merge pull request #20 from CastleCSS/feature/flexbox_equal_height
Feature/flexbox equal height
2 parents d22428d + c142dca commit 5049cc5

File tree

4 files changed

+38
-2
lines changed

4 files changed

+38
-2
lines changed

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "castlecss-core",
3-
"version": "2.3.0",
3+
"version": "2.4.0",
44
"description": "CastleCSS a SCSS framework with modular building blocks for the web",
55
"main": "index.js",
66
"scripts": {

sass/base/utility.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@
4545
list-style: none;
4646
}
4747

48+
.equal-height {
49+
display: flex;
50+
51+
> * {
52+
flex: 1;
53+
}
54+
}
55+
4856
/* Text alignment per breakpoint */
4957
.ta-left { text-align: left; }
5058
.ta-right { text-align: right; }

sass/layout/grid.scss

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
padding: 0; list-style: none;
1616
margin-left: -$grid-gutter;
1717

18+
19+
1820
/* You can turn off flexbox by setting $flexbox-grid: 0; in the variables; */
1921
@if $flexbox-grid == true {
2022
display: flex;
@@ -23,7 +25,7 @@
2325
}
2426

2527
/* Clearfix for older browsers without flexbox */
26-
&:before, &:after {
28+
&:before, &:after {
2729
content: " ";
2830
visibility: hidden;
2931
display: block;
@@ -32,10 +34,31 @@
3234
}
3335

3436
/* Reset grid to floating */
37+
&-float {
38+
display: block;
39+
}
40+
41+
/* Make children of grid items equal height */
42+
&-equal-height {
43+
44+
> * {
45+
display: flex;
46+
47+
> * {
48+
flex: 1;
49+
}
50+
}
51+
}
52+
/*
53+
DO NOT USE; Use g-float.
54+
Legacy class for reset grid to floating
55+
TODO: Remove in new major version
56+
*/
3557
&.grid-float {
3658
display: block;
3759
}
3860

61+
3962
&.dir-row { flex-direction: row; }
4063
&.dir-row-reverse { flex-direction: row-reverse; }
4164
&.dir-column { flex-direction: column; }

0 commit comments

Comments
 (0)