ant-design/components/theme/util/calc/index.ts
二货爱吃白萝卜 3673430978
fix: css var should skip zIndex (#49238)
* fix: css var should skip zIndex

* refactor: calc support unitless

* chore: clean up unit: false

* chore: support zIndex clean up

* chore: fix build

* test: add test case
2024-06-05 20:01:19 +08:00

12 lines
405 B
TypeScript

import type AbstractCalculator from './calculator';
import CSSCalculator from './CSSCalculator';
import NumCalculator from './NumCalculator';
const genCalc = (type: 'css' | 'js', unitlessCssVar: Set<string>) => {
const Calculator = type === 'css' ? CSSCalculator : NumCalculator;
return (num: number | string | AbstractCalculator) => new Calculator(num, unitlessCssVar);
};
export default genCalc;