@@ -11,21 +11,20 @@ import { prepareComponentToken, prepareToken } from './token';
11
11
const genButtonCompactStyle : GenerateStyle < ButtonToken > = ( token ) => {
12
12
const { componentCls, colorPrimaryHover, lineWidth, calc } = token ;
13
13
const insetOffset = calc ( lineWidth ) . mul ( - 1 ) . equal ( ) ;
14
- const getCompactBorderStyle = ( vertical ?: boolean ) =>
15
- ( {
16
- [ `${ componentCls } -compact${ vertical ? '-vertical' : '' } -item${ componentCls } -primary:not([disabled])` ] :
17
- {
18
- '& + &::before' : {
19
- position : 'absolute' ,
20
- top : vertical ? insetOffset : 0 ,
21
- insetInlineStart : vertical ? 0 : insetOffset ,
22
- backgroundColor : colorPrimaryHover ,
23
- content : '""' ,
24
- width : vertical ? '100%' : lineWidth ,
25
- height : vertical ? lineWidth : '100%' ,
26
- } ,
27
- } ,
28
- } ) as CSSObject ;
14
+ const getCompactBorderStyle = ( vertical ?: boolean ) => {
15
+ const selector = `${ componentCls } -compact${ vertical ? '-vertical' : '' } -item${ componentCls } -primary:not([disabled])` ;
16
+ return {
17
+ [ `${ selector } + ${ selector } ::before` ] : {
18
+ position : 'absolute' ,
19
+ top : vertical ? insetOffset : 0 ,
20
+ insetInlineStart : vertical ? 0 : insetOffset ,
21
+ backgroundColor : colorPrimaryHover ,
22
+ content : '""' ,
23
+ width : vertical ? '100%' : lineWidth ,
24
+ height : vertical ? lineWidth : '100%' ,
25
+ } as CSSObject ,
26
+ } ;
27
+ } ;
29
28
// Special styles for Primary Button
30
29
return {
31
30
...getCompactBorderStyle ( ) ,
0 commit comments