mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-26 18:08:34 +08:00
15 lines
402 B
TypeScript
15 lines
402 B
TypeScript
|
import { unit } from '@ant-design/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(',')})`,
|
||
|
};
|
||
|
}
|