Skip to content

Commit 3a969f4

Browse files
committed
fix rtl style recalculation override layer order
1 parent aa58fb4 commit 3a969f4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/src/BrandingCssVarsProvider.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,17 @@ export default function BrandingCssVarsProvider(props: {
150150
setDocsColors(nextPaletteColors.primary, nextPaletteColors.secondary);
151151
}
152152
}, []);
153+
useEnhancedEffect(() => {
154+
if (direction === 'rtl') {
155+
const head = document.querySelector('head');
156+
if (head) {
157+
const style = document.createElement('style');
158+
style.textContent =
159+
'@layer theme, docsearch, mui, mui.global, mui.default, mui.theme, mui.custom, mui.sx, utilities;';
160+
head.prepend(style);
161+
}
162+
}
163+
}, [direction]);
153164
return (
154165
<ThemeProvider
155166
theme={theme}

0 commit comments

Comments
 (0)