useCSSVarCls.js 511 B

1234567891011121314151617
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _internal = require("../../theme/internal");
  7. /**
  8. * This hook is only for cssVar to add root className for components.
  9. * If root ClassName is needed, this hook could be refactored with `-root`
  10. * @param prefixCls
  11. */
  12. const useCSSVarCls = prefixCls => {
  13. const [,,,, cssVar] = (0, _internal.useToken)();
  14. return cssVar ? `${prefixCls}-css-var` : '';
  15. };
  16. var _default = exports.default = useCSSVarCls;