Skip to content

Commit 1252199

Browse files
authored
[material-ui] Skip generating modularCssLayers CSS var (#46329)
1 parent 37d7020 commit 1252199

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/mui-material/src/styles/extendTheme.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,4 +865,11 @@ describe('extendTheme', () => {
865865
]);
866866
});
867867
});
868+
869+
it('should not generate vars for modularCssLayers', () => {
870+
const theme = extendTheme({
871+
modularCssLayers: '@layer mui,utilities;',
872+
});
873+
expect(theme.vars.modularCssLayers).to.equal(undefined);
874+
});
868875
});

packages/mui-material/src/styles/shouldSkipGeneratingVar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default function shouldSkipGeneratingVar(keys: string[]) {
22
return (
33
!!keys[0].match(
4-
/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/,
4+
/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/,
55
) ||
66
!!keys[0].match(/sxConfig$/) || // ends with sxConfig
77
(keys[0] === 'palette' && !!keys[1]?.match(/(mode|contrastThreshold|tonalOffset)/))

0 commit comments

Comments
 (0)