From ca352686dc735e4d3eb1d2b17208af773c91b946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lorber?= Date: Fri, 18 Aug 2023 17:11:52 +0200 Subject: [PATCH] fix(theme-common): ThemedComponent should display something when JS is disabled (#9243) --- .../src/components/ThemedComponent/styles.module.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/docusaurus-theme-common/src/components/ThemedComponent/styles.module.css b/packages/docusaurus-theme-common/src/components/ThemedComponent/styles.module.css index ebf047bd6c4c..e33167ae3d2e 100644 --- a/packages/docusaurus-theme-common/src/components/ThemedComponent/styles.module.css +++ b/packages/docusaurus-theme-common/src/components/ThemedComponent/styles.module.css @@ -16,3 +16,11 @@ [data-theme='dark'] .themedComponent--dark { display: initial; } + +/* +JS disabled??? Show light version by default => better than showing nothing +TODO bad, but we currently always show light mode when there's no data-theme + */ +html:not([data-theme]) .themedComponent--light { + display: initial; +}