You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

functions.web.js 742B

1234567891011121314151617181920212223242526272829303132
  1. // @flow
  2. import { createMuiTheme } from '@material-ui/core/styles';
  3. import { createColorTokens } from './utils';
  4. /**
  5. * Creates a MUI theme based on local UI tokens.
  6. *
  7. * @param {Object} arg - The ui tokens.
  8. * @returns {Object}
  9. */
  10. export function createWebTheme({ font, colors, colorMap, shape, spacing, typography }: Object) {
  11. return createMuiTheme({
  12. props: {
  13. // disable ripple effect on buttons globally
  14. MuiButtonBase: {
  15. disableRipple: true
  16. }
  17. },
  18. // use token spacing array
  19. spacing
  20. }, {
  21. palette: createColorTokens(colorMap, colors),
  22. shape,
  23. typography: {
  24. font,
  25. ...typography
  26. }
  27. });
  28. }