2021-10-08 08:05:16 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import { createStyles, makeStyles } from '@material-ui/core';
|
|
|
|
|
|
|
|
import { commonStyles, getGlobalStyles } from '../constants';
|
|
|
|
import { formatCommonClasses } from '../functions';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates all the global styles.
|
|
|
|
*
|
|
|
|
* @param {Object} theme - The current UI theme.
|
|
|
|
*
|
|
|
|
* @returns {Object}
|
|
|
|
*/
|
|
|
|
const useStyles = makeStyles(theme =>
|
|
|
|
createStyles({
|
|
|
|
'@global': {
|
2021-11-15 08:37:54 +00:00
|
|
|
...formatCommonClasses(commonStyles(theme)),
|
2021-10-08 08:05:16 +00:00
|
|
|
...getGlobalStyles(theme)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A component generating all the global styles.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
function GlobalStyles() {
|
|
|
|
useStyles();
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default GlobalStyles;
|