source: trip-planner-front/node_modules/postcss-ordered-values/dist/rules/flexFlow.js@ 76712b2

Last change on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 719 bytes
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = normalizeFlexFlow;
7// flex-flow: <flex-direction> || <flex-wrap>
8const flexDirection = ['row', 'row-reverse', 'column', 'column-reverse'];
9const flexWrap = ['nowrap', 'wrap', 'wrap-reverse'];
10
11function normalizeFlexFlow(flexFlow) {
12 let order = {
13 direction: '',
14 wrap: ''
15 };
16 flexFlow.walk(({
17 value
18 }) => {
19 if (~flexDirection.indexOf(value.toLowerCase())) {
20 order.direction = value;
21 return;
22 }
23
24 if (~flexWrap.indexOf(value.toLowerCase())) {
25 order.wrap = value;
26 return;
27 }
28 });
29 return `${order.direction} ${order.wrap}`.trim();
30}
31
32module.exports = exports.default;
Note: See TracBrowser for help on using the repository browser.