mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-14 00:41:29 +08:00
c8637cf03a
* feat: Affix support cssVar * fix: fix * fix: fix * fix: fix
31 lines
898 B
TypeScript
31 lines
898 B
TypeScript
import type { CSSObject } from '@ant-design/cssinjs';
|
|
|
|
import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal';
|
|
import { genComponentStyleHook } from '../../theme/internal';
|
|
|
|
export interface ComponentToken {
|
|
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 genComponentStyleHook('Affix', genSharedAffixStyle, prepareComponentToken);
|