Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F105163536
createTheme.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Mar 15, 02:17
Size
1 KB
Mime Type
text/x-java
Expires
Mon, Mar 17, 02:17 (2 d)
Engine
blob
Format
Raw Data
Handle
24932615
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
createTheme.js
View Options
import
_extends
from
"@babel/runtime/helpers/esm/extends"
;
import
_objectWithoutPropertiesLoose
from
"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"
;
const
_excluded
=
[
"breakpoints"
,
"palette"
,
"spacing"
,
"shape"
];
import
{
deepmerge
}
from
'@mui/utils'
;
import
createBreakpoints
from
'./createBreakpoints'
;
import
shape
from
'./shape'
;
import
createSpacing
from
'./createSpacing'
;
import
styleFunctionSx
from
'../styleFunctionSx/styleFunctionSx'
;
import
defaultSxConfig
from
'../styleFunctionSx/defaultSxConfig'
;
function
createTheme
(
options
=
{},
...
args
)
{
const
{
breakpoints
:
breakpointsInput
=
{},
palette
:
paletteInput
=
{},
spacing
:
spacingInput
,
shape
:
shapeInput
=
{}
}
=
options
,
other
=
_objectWithoutPropertiesLoose
(
options
,
_excluded
);
const
breakpoints
=
createBreakpoints
(
breakpointsInput
);
const
spacing
=
createSpacing
(
spacingInput
);
let
muiTheme
=
deepmerge
({
breakpoints
,
direction
:
'ltr'
,
components
:
{},
// Inject component definitions.
palette
:
_extends
({
mode
:
'light'
},
paletteInput
),
spacing
,
shape
:
_extends
({},
shape
,
shapeInput
)
},
other
);
muiTheme
=
args
.
reduce
((
acc
,
argument
)
=>
deepmerge
(
acc
,
argument
),
muiTheme
);
muiTheme
.
unstable_sxConfig
=
_extends
({},
defaultSxConfig
,
other
==
null
?
void
0
:
other
.
unstable_sxConfig
);
muiTheme
.
unstable_sx
=
function
sx
(
props
)
{
return
styleFunctionSx
({
sx
:
props
,
theme
:
this
});
};
return
muiTheme
;
}
export
default
createTheme
;
Event Timeline
Log In to Comment