This commit is contained in:
2025-09-22 18:24:52 +05:30
commit 26ea6d17b1
25 changed files with 5255 additions and 0 deletions

15
app/createCache.ts Normal file
View File

@@ -0,0 +1,15 @@
import createCache from '@emotion/cache';
export default function createEmotionCache(options?: Parameters<typeof createCache>[0]) {
const emotionCache = createCache({ key: 'mui', ...options });
const prevInsert = emotionCache.insert;
emotionCache.insert = (...args) => {
// ignore styles that contain layer order (`@layer ...` without `{`)
if (!args[1].styles.match(/^@layer\s+[^{]*$/)) {
args[1].styles = `@layer mui {${args[1].styles}}`;
}
return prevInsert(...args);
};
return emotionCache;
}