mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-04 17:09:46 +08:00
91f9fc2ff9
* fix: token update * refactor: font map token * chore: code clean * chore: code clean * chore: code clean * chore: update snapshot * chore: menu style
28 lines
894 B
TypeScript
28 lines
894 B
TypeScript
import type { DerivativeFunc } from '@ant-design/cssinjs';
|
|
import genControlHeight from '../shared/genControlHeight';
|
|
import type { MapToken, SeedToken } from '../../interface';
|
|
import defaultAlgorithm from '../default';
|
|
import genCompactSizeMapToken from './genCompactSizeMapToken';
|
|
import genFontMapToken from '../shared/genFontMapToken';
|
|
|
|
const derivative: DerivativeFunc<SeedToken, MapToken> = (token, mapToken) => {
|
|
const mergedMapToken = mapToken ?? defaultAlgorithm(token);
|
|
|
|
const fontSize = mergedMapToken.fontSizeSM; // Smaller size font-size as base
|
|
const controlHeight = mergedMapToken.controlHeight - 4;
|
|
|
|
return {
|
|
...mergedMapToken,
|
|
...genCompactSizeMapToken(mapToken ?? token),
|
|
|
|
// font
|
|
...genFontMapToken(fontSize),
|
|
|
|
// controlHeight
|
|
controlHeight,
|
|
...genControlHeight({ ...mergedMapToken, controlHeight }),
|
|
};
|
|
};
|
|
|
|
export default derivative;
|