ant-design/components/theme/themes/shared/genCommonMapToken.ts
MadCcc 91f9fc2ff9
perf: token update (#39428)
* fix: token update

* refactor: font map token

* chore: code clean

* chore: code clean

* chore: code clean

* chore: update snapshot

* chore: menu style
2022-12-09 17:52:34 +08:00

20 lines
589 B
TypeScript

import type { CommonMapToken, SeedToken } from '../../interface';
import genRadius from './genRadius';
export default function genCommonMapToken(token: SeedToken): CommonMapToken {
const { motionUnit, motionBase, borderRadius, lineWidth } = token;
return {
// motion
motionDurationFast: `${(motionBase + motionUnit).toFixed(1)}s`,
motionDurationMid: `${(motionBase + motionUnit * 2).toFixed(1)}s`,
motionDurationSlow: `${(motionBase + motionUnit * 3).toFixed(1)}s`,
// line
lineWidthBold: lineWidth + 1,
// radius
...genRadius(borderRadius),
};
}