mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-03 00:09:39 +08:00
8e27cf986f
* chore: rm component less file * refactor: less file * refactor: rm less * refactor: rm page-header and comment * chore: rm less in components * chore: update dist config * chore: update image test * chore: update dekko * chore: rm lib dekko * chore: update dist dekko * chore: udpate bundle size * test: update snapshot * test: rm theme test * test: update snapshot * test: update snapshot * chore: copy reset.css * test: update image test * chore: copy reset.css to es * chore: update site script
28 lines
826 B
TypeScript
28 lines
826 B
TypeScript
import type { CSSObject } from '@ant-design/cssinjs';
|
|
import type { FullToken, GenerateStyle } from '../../theme';
|
|
import { genComponentStyleHook, mergeToken } from '../../theme';
|
|
|
|
interface AffixToken extends FullToken<'Affix'> {
|
|
zIndexPopup: number;
|
|
}
|
|
|
|
// ============================== Shared ==============================
|
|
const genSharedAffixStyle: GenerateStyle<AffixToken> = (token): CSSObject => {
|
|
const { componentCls } = token;
|
|
|
|
return {
|
|
[componentCls]: {
|
|
position: 'fixed',
|
|
zIndex: token.zIndexPopup,
|
|
},
|
|
};
|
|
};
|
|
|
|
// ============================== Export ==============================
|
|
export default genComponentStyleHook('Affix', token => {
|
|
const affixToken = mergeToken<AffixToken>(token, {
|
|
zIndexPopup: token.zIndexBase + 10,
|
|
});
|
|
return [genSharedAffixStyle(affixToken)];
|
|
});
|