Skip to content

Commit

Permalink
[system] Shorten class names in production
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Aug 23, 2021
1 parent 49f21f8 commit 76fe285
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/material-ui-system/src/createStyled.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ export default function createStyled(input = {}) {

const skipSx = inputSkipSx || false;

let className;
let label;

if (componentName) {
className = `${componentName}-${lowercaseFirstLetter(componentSlot || 'Root')}`;
if (process.env.NODE_ENV !== 'production') {
if (componentName) {
label = `${componentName}-${lowercaseFirstLetter(componentSlot || 'Root')}`;
}
}

let shouldForwardPropOption = shouldForwardProp;
Expand All @@ -104,7 +106,7 @@ export default function createStyled(input = {}) {

const defaultStyledResolver = styledEngineStyled(tag, {
shouldForwardProp: shouldForwardPropOption,
label: className || componentName || '',
label,
...options,
});
const muiStyledResolver = (styleArg, ...expressions) => {
Expand Down

0 comments on commit 76fe285

Please sign in to comment.