ant-design/components/theme/util/maxmin.ts
MadCcc 96fa23ea7c
refactor: Tooltip, Popover, Dropdown, Tour support css var (#45705)
* feat: Tooltip, Popover, Dropdown, Tour support css var

* chore: update snapshot

* chore: code clean

* chore: code clean

* chore: update snapshot

* chore: update snapshot

* chore: update snapshot

* chore: add test
2023-11-08 14:56:15 +08:00

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(',')})`,
};
}