Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 78e8f45

Browse files
committed
Reintroduce sizeFillAlt using flex-basis: auto
1 parent bc78192 commit 78e8f45

File tree

5 files changed

+81
-1
lines changed

5 files changed

+81
-1
lines changed

lib/size-lg.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@
2020
flex-basis: 0% !important; /* 2 */
2121
}
2222

23+
/**
24+
* An alternative method to make an element fill the remaining space.
25+
* Distributes space based on the initial width and height of the element
26+
*
27+
* http://www.w3.org/TR/css-flexbox/images/rel-vs-abs-flex.svg
28+
*/
29+
30+
.u-lg-sizeFillAlt {
31+
flex: 1 1 auto !important;
32+
flex-basis: auto !important;
33+
}
34+
2335
/**
2436
* Make an element the width of its parent.
2537
*/

lib/size-md.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@
2020
flex-basis: 0% !important; /* 2 */
2121
}
2222

23+
/**
24+
* An alternative method to make an element fill the remaining space.
25+
* Distributes space based on the initial width and height of the element
26+
*
27+
* http://www.w3.org/TR/css-flexbox/images/rel-vs-abs-flex.svg
28+
*/
29+
30+
.u-md-sizeFillAlt {
31+
flex: 1 1 auto !important;
32+
flex-basis: auto !important;
33+
}
34+
2335
/**
2436
* Make an element the width of its parent.
2537
*/

lib/size-sm.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@
2020
flex-basis: 0% !important; /* 2 */
2121
}
2222

23+
/**
24+
* An alternative method to make an element fill the remaining space.
25+
* Distributes space based on the initial width and height of the element
26+
*
27+
* http://www.w3.org/TR/css-flexbox/images/rel-vs-abs-flex.svg
28+
*/
29+
30+
.u-sm-sizeFillAlt {
31+
flex: 1 1 auto !important;
32+
flex-basis: auto !important;
33+
}
34+
2335
/**
2436
* Make an element the width of its parent.
2537
*/

lib/size.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@
1919
flex-basis: 0% !important; /* 2 */
2020
}
2121

22+
/**
23+
* An alternative method to make an element fill the remaining space.
24+
* Distributes space based on the initial width and height of the element
25+
*
26+
* http://www.w3.org/TR/css-flexbox/images/rel-vs-abs-flex.svg
27+
*/
28+
29+
.u-sizeFillAlt {
30+
flex: 1 1 auto !important;
31+
flex-basis: auto !important;
32+
}
33+
2234
/**
2335
* Make an element the width of its parent.
2436
*/

test/index.html

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<div class="Test">
3333
<h1 class="Test-title">SUIT CSS: <a href="https://github.com/suitcss/utils-size">sizing utility</a> tests</h1>
3434

35-
<h2 class="Test-describe">.u-sizeFill</h2>
35+
<h2 class="Test-describe">.u-sizeFill / .u-sizeFillAlt</h2>
3636
<h3 class="Test-it">fills remaining space</h3>
3737
<div class="Test-run">
3838
<div class="u-flex">
@@ -75,6 +75,38 @@ <h3 class="Test-it">distributes space evenly</h3>
7575
</div>
7676
</div>
7777

78+
<h2 class="Test-describe">.u-sizeFillAlt</h2>
79+
<h3 class="Test-it">distributes space based on initial width of item</h3>
80+
<div class="Test-run">
81+
<div class="u-flex">
82+
<div class="u-sizeFillAlt u-highlight">
83+
Lorem ipsum dolor sit amet, probo option similique vix te, ei summo
84+
aliquip nec. Atqui diceret ceteros. Lorem ipsum dolor sit amet.
85+
</div>
86+
<div class="u-sizeFillAlt u-highlight">
87+
content
88+
</div>
89+
<div class="u-sizeFillAlt u-highlight">
90+
content
91+
</div>
92+
</div>
93+
</div>
94+
<div class="Test-run">
95+
<div class="u-flex">
96+
<div class="dev-Box"></div>
97+
<div class="u-sizeFillAlt u-highlight">
98+
Lorem ipsum dolor sit amet, probo option similique vix te, ei summo
99+
aliquip nec. Atqui diceret ceteros.
100+
</div>
101+
<div class="u-sizeFillAlt u-highlight">
102+
content
103+
</div>
104+
<div class="u-sizeFillAlt u-highlight">
105+
content
106+
</div>
107+
</div>
108+
</div>
109+
78110
<h2 class="Test-describe">.u-sizeFull</h2>
79111
<h3 class="Test-it">fits the full-width of the container</h3>
80112
<div class="Test-run">

0 commit comments

Comments
 (0)