first commit
This commit is contained in:
28
build/node_modules/postcss-ordered-values/dist/rules/flexFlow.js
generated
vendored
Normal file
28
build/node_modules/postcss-ordered-values/dist/rules/flexFlow.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = normalizeFlexFlow;
|
||||
// flex-flow: <flex-direction> || <flex-wrap>
|
||||
|
||||
var flexDirection = ['row', 'row-reverse', 'column', 'column-reverse'];
|
||||
|
||||
var flexWrap = ['nowrap', 'wrap', 'wrap-reverse'];
|
||||
|
||||
function normalizeFlexFlow(decl, flexFlow) {
|
||||
var order = {
|
||||
direction: '',
|
||||
wrap: ''
|
||||
};
|
||||
flexFlow.walk(function (node) {
|
||||
if (~flexDirection.indexOf(node.value)) {
|
||||
order.direction = node.value;
|
||||
return;
|
||||
}
|
||||
if (~flexWrap.indexOf(node.value)) {
|
||||
order.wrap = node.value;
|
||||
return;
|
||||
}
|
||||
});
|
||||
decl.value = (order.direction + ' ' + order.wrap).trim();
|
||||
};
|
||||
module.exports = exports['default'];
|
||||
Reference in New Issue
Block a user