mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-07 11:37:58 +08:00
3673430978
* 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
12 lines
405 B
TypeScript
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;
|