File tree Expand file tree Collapse file tree 5 files changed +17
-10
lines changed
Expand file tree Collapse file tree 5 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ module.exports = function(decl) {
2121 }
2222 var values = postcss . list . space ( decl . value ) ;
2323 var flexGrow = values [ 0 ] ;
24- var flexShrink = values [ 1 ] ;
25- var flexBasis = values [ 2 ] || 'auto ' ;
26- decl . value = flexGrow + ' ' + ( flexShrink || '1' ) + ' ' + properBasis ( flexBasis ) ;
24+ var flexShrink = values [ 1 ] || '1' ;
25+ var flexBasis = values [ 2 ] || '0% ' ;
26+ decl . value = flexGrow + ' ' + flexShrink + ' ' + properBasis ( flexBasis ) ;
2727 }
2828} ;
Original file line number Diff line number Diff line change 1+ var postcss = require ( 'postcss' ) ;
2+
13module . exports = function ( decl ) {
24 if ( decl . prop === 'flex' ) {
35 if ( decl . value === 'none' ) {
46 return ;
57 }
8+ var values = postcss . list . space ( decl . value ) ;
9+ var flexGrow = values [ 0 ] ;
10+ var flexShrink = values [ 1 ] || '1' ;
11+ var flexBasis = values [ 2 ] || '0%' ;
12+ decl . value = flexGrow + ' ' + flexShrink + ' ' + flexBasis ;
613 }
714} ;
Original file line number Diff line number Diff line change 11var test = require ( './test' ) ;
22
33describe ( 'bug 4' , function ( ) {
4- it ( 'set auto for default flex-basis and 1 for flex-shrink in flex shorthand' , function ( done ) {
4+ it ( 'set 0% for default flex-basis and 1 for flex-shrink in flex shorthand' , function ( done ) {
55 var input = 'div{flex: 1;}' ;
6- var output = 'div{flex: 1 1 auto ;}' ;
6+ var output = 'div{flex: 1 1 0% ;}' ;
77 test ( input , output , { } , done ) ;
88 } ) ;
9- it ( 'set auto for default flex-basis when not specified' , function ( done ) {
9+ it ( 'set 0% for default flex-basis when not specified' , function ( done ) {
1010 var input = 'div{flex: 1 1;}' ;
11- var output = 'div{flex: 1 1 auto ;}' ;
11+ var output = 'div{flex: 1 1 0% ;}' ;
1212 test ( input , output , { } , done ) ;
1313 } ) ;
1414 it ( 'set flex-basis === 0% for flex-basis with plain 0' , function ( done ) {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ var test = require('./test');
33describe ( 'bug 6' , function ( ) {
44 it ( 'Set flex-shrink to 1 by default' , function ( done ) {
55 var input = 'div{flex: 1;}' ;
6- var output = 'div{flex: 1 1 auto ;}' ;
6+ var output = 'div{flex: 1 1 0% ;}' ;
77 test ( input , output , { } , done ) ;
88 } ) ;
99 describe ( 'does nothing' , function ( ) {
Original file line number Diff line number Diff line change @@ -9,12 +9,12 @@ describe('bug 8.1.a', function() {
99 describe ( 'does nothing' , function ( ) {
1010 it ( 'when using only first value' , function ( done ) {
1111 var input = 'a{flex: 0}' ;
12- var output = 'a{flex: 0 1 auto }' ;
12+ var output = 'a{flex: 0 1 0% }' ;
1313 test ( input , output , { } , done ) ;
1414 } ) ;
1515 it ( 'when using only first and second values' , function ( done ) {
1616 var input = 'a{flex: 0 0}' ;
17- var output = 'a{flex: 0 0 auto }' ;
17+ var output = 'a{flex: 0 0 0% }' ;
1818 test ( input , output , { } , done ) ;
1919 } ) ;
2020 it ( 'when not using calc' , function ( done ) {
You can’t perform that action at this time.
0 commit comments