Browse Source

fix(button): Button block prop not working (#38869)

pull/38877/head
jjlstruggle 2 years ago
committed by GitHub
parent
commit
c4c2ee7e32
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      components/button/style/index.tsx

18
components/button/style/index.tsx

@ -46,10 +46,6 @@ const genSharedButtonStyle: GenerateStyle<ButtonToken, CSSObject> = (token): CSS
marginInlineStart: token.marginXS,
},
[`&${componentCls}-block`]: {
width: '100%',
},
'&:not(:disabled)': {
...genFocusStyle(token),
},
@ -463,6 +459,17 @@ const genSizeLargeButtonStyle: GenerateStyle<ButtonToken> = (token) => {
return genSizeButtonStyle(largeToken, `${token.componentCls}-lg`);
};
const genBlockButtonStyle: GenerateStyle<ButtonToken> = (token) => {
const { componentCls } = token;
return {
[componentCls]: {
[`&${componentCls}-block`]: {
width: '100%',
},
},
};
};
// ============================== Export ==============================
export default genComponentStyleHook('Button', (token) => {
const { controlTmpOutline, paddingContentHorizontal } = token;
@ -481,6 +488,9 @@ export default genComponentStyleHook('Button', (token) => {
genSizeBaseButtonStyle(buttonToken),
genSizeLargeButtonStyle(buttonToken),
// Block
genBlockButtonStyle(buttonToken),
// Group (type, ghost, danger, disabled, loading)
genTypeButtonStyle(buttonToken),

Loading…
Cancel
Save