cssVar.js.flow 521 B

12345678910111213141516171819202122
  1. /**
  2. * Copyright (c) 2013-present, Facebook, Inc.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @providesModule cssVar
  8. */
  9. const fbCSSVars = require("fbjs-css-vars");
  10. const invariant = require("./invariant");
  11. /**
  12. * @param {string} name
  13. */
  14. function cssVar(name) {
  15. invariant(Object.prototype.hasOwnProperty.call(fbCSSVars, name), 'Unknown key passed to cssVar: %s.', name);
  16. return fbCSSVars[name];
  17. }
  18. module.exports = cssVar;