/
CssBaseline.js
55 lines (50 loc) · 1.42 KB
/
CssBaseline.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import React from 'react';
import PropTypes from 'prop-types';
import { makeStyles } from '../styles';
import { exactProp } from '@material-ui/utils';
const useStyles = makeStyles(
theme => ({
'@global': {
html: {
WebkitFontSmoothing: 'antialiased', // Antialiasing.
MozOsxFontSmoothing: 'grayscale', // Antialiasing.
// Change from `box-sizing: content-box` so that `width`
// is not affected by `padding` or `border`.
boxSizing: 'border-box',
},
'*, *::before, *::after': {
boxSizing: 'inherit',
},
body: {
margin: 0, // Remove the margin in all browsers.
color: theme.palette.text.primary,
...theme.typography.body2,
backgroundColor: theme.palette.background.default,
'@media print': {
// Save printer ink.
backgroundColor: theme.palette.common.white,
},
},
},
}),
{ name: 'MuiCssBaseline' },
);
/**
* Kickstart an elegant, consistent, and simple baseline to build upon.
*/
function CssBaseline(props) {
const { children = null } = props;
useStyles();
return <React.Fragment>{children}</React.Fragment>;
}
CssBaseline.propTypes = {
/**
* You can wrap a node.
*/
children: PropTypes.node,
};
if (process.env.NODE_ENV !== 'production') {
// eslint-disable-next-line
CssBaseline['propTypes' + ''] = exactProp(CssBaseline.propTypes);
}
export default CssBaseline;