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

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;