'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _cssvars = require('../theme/cssvars');

var _irisTheme = require('../theme/irisTheme');

var _irisTheme2 = _interopRequireDefault(_irisTheme);

var _lodash = require('lodash');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * @deprecated Provided only to support the legacy theme system.
 * Converts a JSON key (spacing.medium) into a cssvar (var(--spacing-medium)).
 */
var themeGet = function themeGet(k) {
  return function (props) {
    return window.CSS && window.CSS.supports('--css-var', 0) ? 'var(' + (0, _cssvars.cssvarKey)(k) + ')' : (0, _lodash.get)(_irisTheme2.default, k);
  };
};

exports.default = themeGet;