ant-design/components/popconfirm/style/index.tsx
MadCcc 8e27cf986f
chore: rm component less file (#36244)
* 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
2022-07-05 21:55:21 +08:00

83 lines
1.8 KiB
TypeScript

import type { FullToken, GenerateStyle } from '../../theme';
import { genComponentStyleHook } from '../../theme';
export interface ComponentToken {
zIndexPopup: number;
}
export interface PopconfirmToken extends FullToken<'Popconfirm'> {}
// =============================== Base ===============================
const genBaseStyle: GenerateStyle<PopconfirmToken> = token => {
const {
componentCls,
paddingSM,
padding,
paddingXXS,
iconCls,
zIndexPopup,
colorText,
colorWarning,
marginXS,
marginXXS,
fontSize,
lineHeight,
} = token;
return {
[componentCls]: {
zIndex: zIndexPopup,
[`${componentCls}-inner-content`]: {
padding: `${paddingSM}px ${padding}px`,
color: colorText,
},
[`${componentCls}-message`]: {
position: 'relative',
padding: `${paddingXXS}px 0 ${paddingSM}px`,
color: colorText,
fontSize,
display: 'flex',
flexWrap: 'nowrap',
alignItems: 'start',
[`> ${iconCls}`]: {
color: colorWarning,
fontSize,
flex: 'none',
lineHeight: 1,
paddingTop: (Math.round(fontSize * lineHeight) - fontSize) / 2,
},
'&-title': {
flex: 'auto',
marginInlineStart: marginXS,
},
},
[`${componentCls}-buttons`]: {
marginBottom: marginXXS,
textAlign: 'end',
button: {
marginInlineStart: marginXS,
},
},
},
};
};
// ============================== Export ==============================
export default genComponentStyleHook(
'Popconfirm',
token => genBaseStyle(token),
token => {
const { zIndexPopupBase } = token;
return {
zIndexPopup: zIndexPopupBase + 60,
};
},
);