1 | import _extends from "@babel/runtime/helpers/esm/extends";
|
2 | import * as React from 'react';
|
3 | import PropTypes from 'prop-types';
|
4 | import useThemeProps from '../styles/useThemeProps';
|
5 | import GlobalStyles from '../GlobalStyles';
|
6 | import { jsx as _jsx } from "react/jsx-runtime";
|
7 | import { jsxs as _jsxs } from "react/jsx-runtime";
|
8 | export var html = function html(theme, enableColorScheme) {
|
9 | return _extends({
|
10 | WebkitFontSmoothing: 'antialiased',
|
11 |
|
12 | MozOsxFontSmoothing: 'grayscale',
|
13 |
|
14 |
|
15 |
|
16 | boxSizing: 'border-box',
|
17 |
|
18 | WebkitTextSizeAdjust: '100%'
|
19 | }, enableColorScheme && {
|
20 | colorScheme: theme.palette.mode
|
21 | });
|
22 | };
|
23 | export var body = function body(theme) {
|
24 | return _extends({
|
25 | color: (theme.vars || theme).palette.text.primary
|
26 | }, theme.typography.body1, {
|
27 | backgroundColor: (theme.vars || theme).palette.background.default,
|
28 | '@media print': {
|
29 |
|
30 | backgroundColor: (theme.vars || theme).palette.common.white
|
31 | }
|
32 | });
|
33 | };
|
34 |
|
35 | var _styles = function styles(theme) {
|
36 | var _theme$components, _theme$components$Mui;
|
37 |
|
38 | var enableColorScheme = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
39 | var defaultStyles = {
|
40 | html: html(theme, enableColorScheme),
|
41 | '*, *::before, *::after': {
|
42 | boxSizing: 'inherit'
|
43 | },
|
44 | 'strong, b': {
|
45 | fontWeight: theme.typography.fontWeightBold
|
46 | },
|
47 | body: _extends({
|
48 | margin: 0
|
49 | }, body(theme), {
|
50 |
|
51 |
|
52 | '&::backdrop': {
|
53 | backgroundColor: (theme.vars || theme).palette.background.default
|
54 | }
|
55 | })
|
56 | };
|
57 | var themeOverrides = (_theme$components = theme.components) == null ? void 0 : (_theme$components$Mui = _theme$components.MuiCssBaseline) == null ? void 0 : _theme$components$Mui.styleOverrides;
|
58 |
|
59 | if (themeOverrides) {
|
60 | defaultStyles = [defaultStyles, themeOverrides];
|
61 | }
|
62 |
|
63 | return defaultStyles;
|
64 | };
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 | export { _styles as styles };
|
71 |
|
72 | function CssBaseline(inProps) {
|
73 | var props = useThemeProps({
|
74 | props: inProps,
|
75 | name: 'MuiCssBaseline'
|
76 | });
|
77 | var children = props.children,
|
78 | _props$enableColorSch = props.enableColorScheme,
|
79 | enableColorScheme = _props$enableColorSch === void 0 ? false : _props$enableColorSch;
|
80 | return _jsxs(React.Fragment, {
|
81 | children: [_jsx(GlobalStyles, {
|
82 | styles: function styles(theme) {
|
83 | return _styles(theme, enableColorScheme);
|
84 | }
|
85 | }), children]
|
86 | });
|
87 | }
|
88 |
|
89 | process.env.NODE_ENV !== "production" ? CssBaseline.propTypes
|
90 |
|
91 | = {
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 | |
98 |
|
99 |
|
100 | children: PropTypes.node,
|
101 |
|
102 | |
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 | enableColorScheme: PropTypes.bool
|
109 | } : void 0;
|
110 | export default CssBaseline; |
\ | No newline at end of file |