You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
814 B
27 lines
814 B
// 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)];
|
|
});
|
|
|