This commit is contained in:
2025-09-19 14:25:20 +08:00
parent 269893a435
commit fbf3f77229
24949 changed files with 2839404 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
'use strict';
// flex-flow: <flex-direction> || <flex-wrap>
const flexDirection = new Set([
'row',
'row-reverse',
'column',
'column-reverse',
]);
const flexWrap = new Set(['nowrap', 'wrap', 'wrap-reverse']);
/**
* @param {import('postcss-value-parser').ParsedValue} flexFlow
* @return {string}
*/
module.exports = function normalizeFlexFlow(flexFlow) {
let order = {
direction: '',
wrap: '',
};
flexFlow.walk(({ value }) => {
if (flexDirection.has(value.toLowerCase())) {
order.direction = value;
return;
}
if (flexWrap.has(value.toLowerCase())) {
order.wrap = value;
return;
}
});
return `${order.direction} ${order.wrap}`.trim();
};