This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/postcss-ordered-values/dist/rules/flexFlow.js

34 lines
781 B
JavaScript
Raw Permalink Normal View History

2019-08-11 18:48:02 +00:00
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = normalizeFlexFlow;
// flex-flow: <flex-direction> || <flex-wrap>
const flexDirection = ['row', 'row-reverse', 'column', 'column-reverse'];
const flexWrap = ['nowrap', 'wrap', 'wrap-reverse'];
function normalizeFlexFlow(flexFlow) {
let order = {
direction: '',
wrap: ''
};
flexFlow.walk(({ value }) => {
if (~flexDirection.indexOf(value.toLowerCase())) {
order.direction = value;
return;
}
if (~flexWrap.indexOf(value.toLowerCase())) {
order.wrap = value;
return;
}
});
return `${order.direction} ${order.wrap}`.trim();
};
module.exports = exports['default'];