From ed0436b387ced7ad341af27deb4e79971327830f Mon Sep 17 00:00:00 2001 From: yinyahui Date: Mon, 12 Dec 2022 14:24:22 +0800 Subject: [PATCH] refactor: ghostButtonStyle merge --- docs/examples/components/Button.tsx | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/docs/examples/components/Button.tsx b/docs/examples/components/Button.tsx index 4218589e..daab51f3 100644 --- a/docs/examples/components/Button.tsx +++ b/docs/examples/components/Button.tsx @@ -21,7 +21,7 @@ const genSharedButtonStyle = ( }, }); -// 实心底色样式 +// 底色样式 const genSolidButtonStyle = ( prefixCls: string, token: DerivativeToken, @@ -69,21 +69,17 @@ const genPrimaryButtonStyle = ( const genGhostButtonStyle = ( prefixCls: string, token: DerivativeToken, -): CSSInterpolation => [ - genSharedButtonStyle(prefixCls, token), - { - [`.${prefixCls}`]: { - backgroundColor: 'transparent', - color: token.primaryColor, - border: `${token.borderWidth}px solid ${token.primaryColor}`, +): CSSInterpolation => + genSolidButtonStyle(prefixCls, token, () => ({ + backgroundColor: 'transparent', + color: token.primaryColor, + border: `${token.borderWidth}px solid ${token.primaryColor}`, - '&:hover': { - borderColor: token.primaryColor, - color: token.primaryColor, - }, + '&:hover': { + borderColor: token.primaryColor, + color: token.primaryColor, }, - }, -]; + })); interface ButtonProps extends Omit, 'type'> {