Skip to content

Commit

Permalink
fix(button): Button block prop not working (#38869)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjlstruggle committed Nov 22, 2022
1 parent 57f9916 commit c4c2ee7
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions components/button/style/index.tsx
Expand Up @@ -46,10 +46,6 @@ const genSharedButtonStyle: GenerateStyle<ButtonToken, CSSObject> = (token): CSS
marginInlineStart: token.marginXS,
},

[`&${componentCls}-block`]: {
width: '100%',
},

'&:not(:disabled)': {
...genFocusStyle(token),
},
Expand Down Expand Up @@ -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;
Expand All @@ -481,6 +488,9 @@ export default genComponentStyleHook('Button', (token) => {
genSizeBaseButtonStyle(buttonToken),
genSizeLargeButtonStyle(buttonToken),

// Block
genBlockButtonStyle(buttonToken),

// Group (type, ghost, danger, disabled, loading)
genTypeButtonStyle(buttonToken),

Expand Down

0 comments on commit c4c2ee7

Please sign in to comment.