Browse Source

fix: v5 component style (#37413)

* fix: v5 component style

* chore: fix csp
pull/37432/head
MadCcc 2 years ago
committed by GitHub
parent
commit
870f9e504d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      components/config-provider/index.tsx
  2. 4
      components/mentions/style/index.tsx
  3. 8
      components/popconfirm/style/index.tsx

9
components/config-provider/index.tsx

@ -142,7 +142,7 @@ export const globalConfig = () => ({
const ProviderChildren: React.FC<ProviderChildrenProps> = props => {
const {
children,
csp,
csp: customCsp,
autoInsertSpaceInButton,
form,
locale,
@ -153,7 +153,7 @@ const ProviderChildren: React.FC<ProviderChildrenProps> = props => {
dropdownMatchSelectWidth,
legacyLocale,
parentContext,
iconPrefixCls,
iconPrefixCls: customIconPrefixCls,
theme,
componentDisabled,
} = props;
@ -171,6 +171,9 @@ const ProviderChildren: React.FC<ProviderChildrenProps> = props => {
[parentContext.getPrefixCls, props.prefixCls],
);
const iconPrefixCls = customIconPrefixCls || parentContext.iconPrefixCls || defaultIconPrefixCls;
const csp = customCsp || parentContext.csp;
const mergedTheme = useTheme(theme, parentContext.theme);
const config = {
@ -183,7 +186,7 @@ const ProviderChildren: React.FC<ProviderChildrenProps> = props => {
virtual,
dropdownMatchSelectWidth,
getPrefixCls,
iconPrefixCls: iconPrefixCls ?? defaultIconPrefixCls,
iconPrefixCls,
theme: mergedTheme,
};

4
components/mentions/style/index.tsx

@ -34,7 +34,7 @@ const genMentionsStyle: GenerateStyle<MentionsToken> = token => {
fontSize,
colorBgElevated,
controlRadiusLG,
boxShadow,
boxShadowSecondary,
} = token;
const itemPaddingVertical = Math.round(
@ -144,7 +144,7 @@ const genMentionsStyle: GenerateStyle<MentionsToken> = token => {
backgroundColor: colorBgElevated,
borderRadius: controlRadiusLG,
outline: 'none',
boxShadow,
boxShadow: boxShadowSecondary,
'&-hidden': {
display: 'none',

8
components/popconfirm/style/index.tsx

@ -11,15 +11,11 @@ export interface PopconfirmToken extends FullToken<'Popconfirm'> {}
const genBaseStyle: GenerateStyle<PopconfirmToken> = token => {
const {
componentCls,
paddingSM,
padding,
paddingXXS,
iconCls,
zIndexPopup,
colorText,
colorWarning,
marginXS,
marginXXS,
fontSize,
lineHeight,
} = token;
@ -29,13 +25,12 @@ const genBaseStyle: GenerateStyle<PopconfirmToken> = token => {
zIndex: zIndexPopup,
[`${componentCls}-inner-content`]: {
padding: `${paddingSM}px ${padding}px`,
color: colorText,
},
[`${componentCls}-message`]: {
position: 'relative',
padding: `${paddingXXS}px 0 ${paddingSM}px`,
marginBottom: marginXS,
color: colorText,
fontSize,
display: 'flex',
@ -57,7 +52,6 @@ const genBaseStyle: GenerateStyle<PopconfirmToken> = token => {
},
[`${componentCls}-buttons`]: {
marginBottom: marginXXS,
textAlign: 'end',
button: {

Loading…
Cancel
Save