initial commit
This commit is contained in:
34
node_modules/postcss-ordered-values/dist/rules/flexFlow.js
generated
vendored
Normal file
34
node_modules/postcss-ordered-values/dist/rules/flexFlow.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
'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'];
|
||||
Reference in New Issue
Block a user