ant-design/components/affix/style/index.tsx
MadCcc 101865cf7e
fix: statistic token (#34962)
* fix: statistic token

* fix: all components token

* test: fix lint

* chore: code clean

* Revert "chore: code clean"

This reverts commit 2c0e7d6ba3.
2022-04-11 16:04:00 +08:00

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)];
});