mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-30 04:18:28 +08:00
502dac12aa
* docs: fix code * feat: lint * feat: prettier * feat: test * feat: review * feat: format html * feat: format html
29 lines
895 B
TypeScript
29 lines
895 B
TypeScript
import type { DerivativeFunc } from '@ant-design/cssinjs';
|
|
|
|
import type { MapToken, SeedToken } from '../../interface';
|
|
import defaultAlgorithm from '../default';
|
|
import genControlHeight from '../shared/genControlHeight';
|
|
import genFontMapToken from '../shared/genFontMapToken';
|
|
import genCompactSizeMapToken from './genCompactSizeMapToken';
|
|
|
|
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;
|