Skip to content

Commit b59d452

Browse files
committed
docs: fix css
1 parent f502c06 commit b59d452

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

website/src/theme/DocSidebar/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ function setColorMode(banner, colorMode) {
5555
export default function DocSidebar(props) {
5656
const bannerRef = useRef();
5757
const { colorMode } = useColorMode();
58+
const colorModeRef = useRef(colorMode);
59+
60+
colorModeRef.current = colorMode;
5861

5962
useEffect(() => {
6063
if (!document.getElementById('bwndw')) {
@@ -63,7 +66,7 @@ export default function DocSidebar(props) {
6366
const root = document.querySelector('.theme-doc-sidebar-menu')?.parentElement;
6467

6568
bannerRef.current = useFallback ? createCarbonAdsBlock(root) : createEthicalAdsBlock(root);
66-
setColorMode(bannerRef.current, colorMode);
69+
setColorMode(bannerRef.current, colorModeRef.current);
6770
}
6871
});
6972
}

0 commit comments

Comments
 (0)