useCSSVarCls.js 372 B

1234567891011
  1. import { useToken } from '../../theme/internal';
  2. /**
  3. * This hook is only for cssVar to add root className for components.
  4. * If root ClassName is needed, this hook could be refactored with `-root`
  5. * @param prefixCls
  6. */
  7. const useCSSVarCls = prefixCls => {
  8. const [,,,, cssVar] = useToken();
  9. return cssVar ? `${prefixCls}-css-var` : '';
  10. };
  11. export default useCSSVarCls;