ant-design/components/affix/style/index.ts
lijianan c8637cf03a
feat: Affix support cssVar (#45807)
* feat: Affix support cssVar

* fix: fix

* fix: fix

* fix: fix
2023-11-13 20:25:05 +08:00

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