Skip to content

Commit 837d9f6

Browse files
committed
add layer custom and rename base to default
1 parent 1955562 commit 837d9f6

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

docs/src/modules/utils/StyledEngineProvider.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default function StyledEngineProvider(props) {
2727
return (
2828
<StyleSheetManager stylisPlugins={rtl ? [rtlPlugin] : []}>
2929
<CacheProvider value={emotionCache}>
30-
<GlobalStyles styles="@layer theme, docsearch, mui, mui.base, mui.base-variants, mui.theme, mui.theme-variants, mui.sx, utilities;" />
30+
<GlobalStyles styles="@layer theme, docsearch, mui, mui.default, mui.default-variants, mui.theme, mui.theme-variants, mui.custom, mui.custom-variants, mui.sx, utilities;" />
3131
{children}
3232
</CacheProvider>
3333
</StyleSheetManager>

packages/mui-system/src/createStyled/createStyled.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ export default function createStyled(input = {}) {
141141
...options
142142
} = inputOptions;
143143

144+
const layerName = componentName ? 'default' : 'custom';
145+
144146
// if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
145147
const skipVariantsResolver =
146148
inputSkipVariantsResolver !== undefined
@@ -180,7 +182,7 @@ export default function createStyled(input = {}) {
180182
return processStyle(
181183
props,
182184
style,
183-
props.theme.experimental_modularCssLayers ? 'base' : undefined,
185+
props.theme.experimental_modularCssLayers ? layerName : undefined,
184186
);
185187
};
186188
}
@@ -189,13 +191,13 @@ export default function createStyled(input = {}) {
189191
return function styleObjectProcessor(props) {
190192
if (!serialized.variants) {
191193
return props.theme.experimental_modularCssLayers
192-
? shallowLayer(serialized.style, 'base')
194+
? shallowLayer(serialized.style, layerName)
193195
: serialized.style;
194196
}
195197
return processStyle(
196198
props,
197199
serialized,
198-
props.theme.experimental_modularCssLayers ? 'base' : undefined,
200+
props.theme.experimental_modularCssLayers ? layerName : undefined,
199201
);
200202
};
201203
}

0 commit comments

Comments
 (0)