2022-05-09 22:20:07 +08:00
|
|
|
import type { CSSObject } from '@ant-design/cssinjs';
|
2022-03-22 13:27:12 +08:00
|
|
|
|
2023-11-13 20:25:05 +08:00
|
|
|
import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal';
|
|
|
|
import { genComponentStyleHook } from '../../theme/internal';
|
|
|
|
|
|
|
|
export interface ComponentToken {
|
2022-05-17 21:57:22 +08:00
|
|
|
zIndexPopup: number;
|
2022-03-22 13:27:12 +08:00
|
|
|
}
|
|
|
|
|
2023-11-13 20:25:05 +08:00
|
|
|
interface AffixToken extends FullToken<'Affix'> {
|
|
|
|
//
|
|
|
|
}
|
|
|
|
|
2022-03-22 13:27:12 +08:00
|
|
|
// ============================== Shared ==============================
|
|
|
|
const genSharedAffixStyle: GenerateStyle<AffixToken> = (token): CSSObject => {
|
2022-04-07 14:53:13 +08:00
|
|
|
const { componentCls } = token;
|
2022-03-22 13:27:12 +08:00
|
|
|
return {
|
2022-04-07 14:53:13 +08:00
|
|
|
[componentCls]: {
|
2022-03-22 13:27:12 +08:00
|
|
|
position: 'fixed',
|
2022-05-17 21:57:22 +08:00
|
|
|
zIndex: token.zIndexPopup,
|
2022-03-22 13:27:12 +08:00
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-11-13 20:25:05 +08:00
|
|
|
export const prepareComponentToken: GetDefaultToken<'Affix'> = (token) => ({
|
|
|
|
zIndexPopup: token.zIndexBase + 10,
|
2022-04-07 14:53:13 +08:00
|
|
|
});
|
2023-11-13 20:25:05 +08:00
|
|
|
|
|
|
|
// ============================== Export ==============================
|
|
|
|
export default genComponentStyleHook('Affix', genSharedAffixStyle, prepareComponentToken);
|