ant-design-vue/components/theme/util/maxmin.ts

15 lines
398 B
TypeScript

import { unit } from '../../_util/cssinjs';
export default function genMaxMin(type: 'css' | 'js') {
if (type === 'js') {
return {
max: Math.max,
min: Math.min,
};
}
return {
max: (...args: (string | number)[]) => `max(${args.map(value => unit(value)).join(',')})`,
min: (...args: (string | number)[]) => `min(${args.map(value => unit(value)).join(',')})`,
};
}