File tree 2 files changed +10
-8
lines changed
packages/mui-utils/src/composeClasses
2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ describe('composeClasses', () => {
13
13
undefined ,
14
14
) ,
15
15
) . to . deep . equal ( {
16
- root : 'MuiTest-root MuiTest-standard ' ,
17
- slot : 'MuiTest-slot ' ,
16
+ root : 'MuiTest-root MuiTest-standard' ,
17
+ slot : 'MuiTest-slot' ,
18
18
} ) ;
19
19
} ) ;
20
20
@@ -32,8 +32,8 @@ describe('composeClasses', () => {
32
32
} ,
33
33
) ,
34
34
) . to . deep . equal ( {
35
- root : 'MuiTest-root MuiTest-standard standardOverride ' ,
36
- slot : 'MuiTest-slot slotOverride ' ,
35
+ root : 'MuiTest-root MuiTest-standard standardOverride' ,
36
+ slot : 'MuiTest-slot slotOverride' ,
37
37
} ) ;
38
38
} ) ;
39
39
@@ -51,8 +51,8 @@ describe('composeClasses', () => {
51
51
} ,
52
52
) ,
53
53
) . to . deep . equal ( {
54
- root : 'MuiTest-root MuiTest-standard standardOverride ' ,
55
- slot : 'MuiTest-slot slotOverride ' ,
54
+ root : 'MuiTest-root MuiTest-standard standardOverride' ,
55
+ slot : 'MuiTest-slot slotOverride' ,
56
56
} ) ;
57
57
} ) ;
58
58
} ) ;
Original file line number Diff line number Diff line change @@ -13,14 +13,16 @@ export default function composeClasses<ClassKey extends string>(
13
13
for ( const slotName in slots ) {
14
14
const slot = slots [ slotName ] ;
15
15
let buffer = '' ;
16
+ let start = true ;
16
17
17
18
for ( let i = 0 ; i < slot . length ; i += 1 ) {
18
19
const value = slot [ i ] ;
19
20
if ( value ) {
20
- buffer += getUtilityClass ( value ) + ' ' ;
21
+ buffer += ( start === true ? '' : ' ' ) + getUtilityClass ( value ) ;
22
+ start = false ;
21
23
22
24
if ( classes && classes [ value ] ) {
23
- buffer += classes [ value ] + ' ' ;
25
+ buffer += ' ' + classes [ value ] ;
24
26
}
25
27
}
26
28
}
You can’t perform that action at this time.
0 commit comments