Skip to content

Commit 10382c4

Browse files
shu-harinishu
andauthored
feat: tabs css var (#8330)
Co-authored-by: nishu <[email protected]>
1 parent 35f832c commit 10382c4

File tree

2 files changed

+301
-116
lines changed

2 files changed

+301
-116
lines changed

components/tabs/src/Tabs.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import pick from 'lodash-es/pick';
4141
import PropTypes from '../../_util/vue-types';
4242
import type { MouseEventHandler } from '../../_util/EventInterface';
4343
import omit from '../../_util/omit';
44+
import useCSSVarCls from '../../config-provider/hooks/useCssVarCls';
4445
import useStyle from '../style';
4546
export type TabsType = 'line' | 'card' | 'editable-card';
4647
export type TabsPosition = 'top' | 'right' | 'bottom' | 'left';
@@ -169,7 +170,8 @@ const InternalTabs = defineComponent({
169170
'tabs',
170171
props,
171172
);
172-
const [wrapSSR, hashId] = useStyle(prefixCls);
173+
const rootCls = useCSSVarCls(prefixCls);
174+
const [wrapSSR, hashId, cssVarCls] = useStyle(prefixCls, rootCls);
173175
const rtl = computed(() => direction.value === 'rtl');
174176
const mergedAnimated = computed<AnimatedConfig>(() => {
175177
const { animated, tabPosition } = props;
@@ -322,6 +324,8 @@ const InternalTabs = defineComponent({
322324
pre,
323325
`${pre}-${mergedTabPosition.value}`,
324326
{
327+
[cssVarCls.value]: true,
328+
[rootCls.value]: true,
325329
[hashId.value]: true,
326330
[`${pre}-${size.value}`]: size.value,
327331
[`${pre}-card`]: ['card', 'editable-card'].includes(type as string),

0 commit comments

Comments
 (0)