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.

GlobalStyles.js 665B

1234567891011121314151617181920212223242526272829303132333435
  1. // @flow
  2. import { createStyles, makeStyles } from '@material-ui/core';
  3. import { commonStyles, getGlobalStyles } from '../constants';
  4. import { formatCommonClasses } from '../functions';
  5. /**
  6. * Creates all the global styles.
  7. *
  8. * @param {Object} theme - The current UI theme.
  9. *
  10. * @returns {Object}
  11. */
  12. const useStyles = makeStyles(theme =>
  13. createStyles({
  14. '@global': {
  15. ...formatCommonClasses(commonStyles),
  16. ...getGlobalStyles(theme)
  17. }
  18. })
  19. );
  20. /**
  21. * A component generating all the global styles.
  22. *
  23. * @returns {void}
  24. */
  25. function GlobalStyles() {
  26. useStyles();
  27. return null;
  28. }
  29. export default GlobalStyles;