Skip to content

Commit

Permalink
add flexbox
Browse files Browse the repository at this point in the history
  • Loading branch information
mkupriichuk committed May 16, 2020
1 parent 1518734 commit cce1a09
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ module.exports = [{
properties: ['border-width', 'border-style', 'border-color'],
shorthandSyntax: 'border-width border-style border-color',
getShorthandValue: require('./shorthanders/border')
}, {
shorthandProperty: 'flex',
properties: ['flex-grow', 'flex-shrink', 'flex-basis'],
shorthandSyntax: 'flex-grow flex-shrink flex-basis',
getShorthandValue: require('./shorthanders/flex')
}, {
shorthandProperty: 'outline',
properties: ['outline-width', 'outline-style', 'outline-color'],
Expand Down
9 changes: 9 additions & 0 deletions lib/shorthanders/flex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = function(shorthand, declarations) {
var shorthandValue = require('./generic')(shorthand, declarations);

if (!declarations['flex-grow'] || !declarations['flex-shrink']) {
return '';
}

return shorthandValue.replace(' ', ' ').trim();
};

0 comments on commit cce1a09

Please sign in to comment.