您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

utils.ts 696B

123456789101112131415161718192021
  1. import { merge } from 'lodash';
  2. import * as jitsiTokens from './jitsiTokens.json';
  3. import * as tokens from './tokens.json';
  4. /**
  5. * Creates the color tokens based on the color theme and the association map.
  6. *
  7. * @param {Object} colorMap - A map between the token name and the actual color value.
  8. * @returns {Object}
  9. */
  10. export function createColorTokens(colorMap: Object): any {
  11. const allTokens = merge({}, tokens, jitsiTokens);
  12. return Object.entries(colorMap)
  13. .reduce((result, [ token, value ]: [any, string]) => {
  14. const color = allTokens[value as keyof typeof allTokens] || value;
  15. return Object.assign(result, { [token]: color });
  16. }, {});
  17. }