@@ -7,6 +7,7 @@ import type { SizeType } from '../config-provider';
7
7
import isPlainObject from 'lodash-es/isPlainObject' ;
8
8
import useConfigInject from '../config-provider/hooks/useConfigInject' ;
9
9
import devWarning from '../vc-util/devWarning' ;
10
+ import useCSSVarCls from '../config-provider/hooks/useCssVarCls' ;
10
11
import useStyle from './style' ;
11
12
import Skeleton from '../skeleton' ;
12
13
import type { CustomSlotsType } from '../_util/type' ;
@@ -67,7 +68,8 @@ const Card = defineComponent({
67
68
} > ,
68
69
setup ( props , { slots, attrs } ) {
69
70
const { prefixCls, direction, size } = useConfigInject ( 'card' , props ) ;
70
- const [ wrapSSR , hashId ] = useStyle ( prefixCls ) ;
71
+ const rootCls = useCSSVarCls ( prefixCls ) ;
72
+ const [ wrapSSR , hashId , cssVarCls ] = useStyle ( prefixCls , rootCls ) ;
71
73
const getAction = ( actions : VNodeTypes [ ] ) => {
72
74
const actionList = actions . map ( ( action , index ) =>
73
75
( isVNode ( action ) && ! isEmptyElement ( action ) ) || ! isVNode ( action ) ? (
@@ -112,6 +114,8 @@ const Card = defineComponent({
112
114
const pre = prefixCls . value ;
113
115
const classString = {
114
116
[ `${ pre } ` ] : true ,
117
+ [ cssVarCls . value ] : true ,
118
+ [ rootCls . value ] : true ,
115
119
[ hashId . value ] : true ,
116
120
[ `${ pre } -loading` ] : loading ,
117
121
[ `${ pre } -bordered` ] : bordered ,
0 commit comments