UNPKG

2.39 kBJavaScriptView Raw
1import _extends from "@babel/runtime/helpers/esm/extends";
2import * as React from 'react';
3import PropTypes from 'prop-types';
4import withStyles from '../styles/withStyles';
5import { exactProp } from '@material-ui/utils';
6export const html = {
7 WebkitFontSmoothing: 'antialiased',
8 // Antialiasing.
9 MozOsxFontSmoothing: 'grayscale',
10 // Antialiasing.
11 // Change from `box-sizing: content-box` so that `width`
12 // is not affected by `padding` or `border`.
13 boxSizing: 'border-box'
14};
15export const body = theme => _extends({
16 color: theme.palette.text.primary
17}, theme.typography.body2, {
18 backgroundColor: theme.palette.background.default,
19 '@media print': {
20 // Save printer ink.
21 backgroundColor: theme.palette.common.white
22 }
23});
24export const styles = theme => ({
25 '@global': {
26 html,
27 '*, *::before, *::after': {
28 boxSizing: 'inherit'
29 },
30 'strong, b': {
31 fontWeight: theme.typography.fontWeightBold
32 },
33 body: _extends({
34 margin: 0
35 }, body(theme), {
36 // Add support for document.body.requestFullScreen().
37 // Other elements, if background transparent, are not supported.
38 '&::backdrop': {
39 backgroundColor: theme.palette.background.default
40 }
41 })
42 }
43});
44/**
45 * Kickstart an elegant, consistent, and simple baseline to build upon.
46 */
47
48function CssBaseline(props) {
49 /* eslint-disable no-unused-vars */
50 const {
51 children = null,
52 classes
53 } = props;
54 /* eslint-enable no-unused-vars */
55
56 return /*#__PURE__*/React.createElement(React.Fragment, null, children);
57}
58
59process.env.NODE_ENV !== "production" ? CssBaseline.propTypes = {
60 // ----------------------------- Warning --------------------------------
61 // | These PropTypes are generated from the TypeScript type definitions |
62 // | To update them edit the d.ts file and run "yarn proptypes" |
63 // ----------------------------------------------------------------------
64
65 /**
66 * You can wrap a node.
67 */
68 children: PropTypes.node,
69
70 /**
71 * Override or extend the styles applied to the component.
72 * See [CSS API](#css) below for more details.
73 */
74 classes: PropTypes.object
75} : void 0;
76
77if (process.env.NODE_ENV !== 'production') {
78 // eslint-disable-next-line
79 CssBaseline['propTypes' + ''] = exactProp(CssBaseline.propTypes);
80}
81
82export default withStyles(styles, {
83 name: 'MuiCssBaseline'
84})(CssBaseline);
\No newline at end of file