diff --git a/components/button/button-group.tsx b/components/button/button-group.tsx index 2dbbb9d09d..93934ac80e 100644 --- a/components/button/button-group.tsx +++ b/components/button/button-group.tsx @@ -3,6 +3,7 @@ import classNames from 'classnames'; import { SizeType } from '../config-provider/SizeContext'; import { ConfigContext } from '../config-provider'; import devWarning from '../_util/devWarning'; +import { useToken } from '../_util/theme'; export interface ButtonGroupProps { size?: SizeType; @@ -20,6 +21,9 @@ const ButtonGroup: React.FC = props => { const { prefixCls: customizePrefixCls, size, className, ...others } = props; const prefixCls = getPrefixCls('btn-group', customizePrefixCls); + // Here we only need hashId + const [, , hashId] = useToken(); + // large => lg // small => sm let sizeCls = ''; @@ -44,6 +48,7 @@ const ButtonGroup: React.FC = props => { [`${prefixCls}-rtl`]: direction === 'rtl', }, className, + hashId, ); return ( diff --git a/components/button/demo/legacy-group.md b/components/button/demo/legacy-group.md index 54a027dff0..15fc949afe 100644 --- a/components/button/demo/legacy-group.md +++ b/components/button/demo/legacy-group.md @@ -45,9 +45,3 @@ export default () => ( ); ``` - -```css -#components-button-demo-legacy-group .ant-btn { - margin: 0; -} -``` diff --git a/components/button/index.en-US.md b/components/button/index.en-US.md index 391961a25a..6fb5233da6 100644 --- a/components/button/index.en-US.md +++ b/components/button/index.en-US.md @@ -57,18 +57,14 @@ Following the Ant Design specification, we will add one space between if Button Button with two Chinese characters