mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-12 07:09:55 +08:00
101865cf7e
* fix: statistic token
* fix: all components token
* test: fix lint
* chore: code clean
* Revert "chore: code clean"
This reverts commit 2c0e7d6ba3
.
28 lines
814 B
TypeScript
28 lines
814 B
TypeScript
// deps-lint-skip-all
|
|
import { CSSObject } from '@ant-design/cssinjs';
|
|
import { GenerateStyle, genComponentStyleHook, FullToken, mergeToken } from '../../_util/theme';
|
|
|
|
interface AffixToken extends FullToken<'Affix'> {
|
|
zIndexAffix: number;
|
|
}
|
|
|
|
// ============================== Shared ==============================
|
|
const genSharedAffixStyle: GenerateStyle<AffixToken> = (token): CSSObject => {
|
|
const { componentCls } = token;
|
|
|
|
return {
|
|
[componentCls]: {
|
|
position: 'fixed',
|
|
zIndex: token.zIndexAffix,
|
|
},
|
|
};
|
|
};
|
|
|
|
// ============================== Export ==============================
|
|
export default genComponentStyleHook('Affix', token => {
|
|
const affixToken = mergeToken<AffixToken>(token, {
|
|
zIndexAffix: token.zIndexBase + 10,
|
|
});
|
|
return [genSharedAffixStyle(affixToken)];
|
|
});
|