diff --git a/packages/mui-system/src/createStyled.js b/packages/mui-system/src/createStyled.js index da61ca564547da..eaaf392f62cb8c 100644 --- a/packages/mui-system/src/createStyled.js +++ b/packages/mui-system/src/createStyled.js @@ -66,7 +66,7 @@ function processStyleArg(callableStyle, { ownerState, ...props }) { variants.forEach((variant) => { let isMatch = true; if (typeof variant.props === 'function') { - isMatch = variant.props({ ownerState, ...props }); + isMatch = variant.props({ ownerState, ...props, ...ownerState }); } else { Object.keys(variant.props).forEach((key) => { if (ownerState?.[key] !== variant.props[key] && props[key] !== variant.props[key]) { @@ -80,7 +80,7 @@ function processStyleArg(callableStyle, { ownerState, ...props }) { } result.push( typeof variant.style === 'function' - ? variant.style({ ownerState, ...props }) + ? variant.style({ ownerState, ...props, ...ownerState }) : variant.style, ); }