mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-19 03:54:28 +08:00
35 lines
956 B
TypeScript
35 lines
956 B
TypeScript
import type { CSSObject } from '@ant-design/cssinjs';
|
|
|
|
import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal';
|
|
import { genStyleHooks } from '../../theme/internal';
|
|
|
|
export interface ComponentToken {
|
|
/**
|
|
* @desc 弹出层的 z-index
|
|
* @descEN z-index of popup
|
|
*/
|
|
zIndexPopup: number;
|
|
}
|
|
|
|
interface AffixToken extends FullToken<'Affix'> {
|
|
//
|
|
}
|
|
|
|
// ============================== Shared ==============================
|
|
const genSharedAffixStyle: GenerateStyle<AffixToken> = (token): CSSObject => {
|
|
const { componentCls } = token;
|
|
return {
|
|
[componentCls]: {
|
|
position: 'fixed',
|
|
zIndex: token.zIndexPopup,
|
|
},
|
|
};
|
|
};
|
|
|
|
export const prepareComponentToken: GetDefaultToken<'Affix'> = (token) => ({
|
|
zIndexPopup: token.zIndexBase + 10,
|
|
});
|
|
|
|
// ============================== Export ==============================
|
|
export default genStyleHooks('Affix', genSharedAffixStyle, prepareComponentToken);
|