From c30b77b01421d2b2c5710563db04a8d9f40e3ae4 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 18 Aug 2023 16:32:04 +0200 Subject: [PATCH 1/3] fix nojs themed comp display --- .../src/components/ThemedComponent/styles.module.css | 9 +++++++++ 1 file changed, 9 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..69f32137af43 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,12 @@ [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 + */ + +:not[data-theme] .themedComponent--light { + display: initial; +} From 0f4fb2e2ee053ea52a7bbef4c0be0e60993060bc Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 18 Aug 2023 16:39:25 +0200 Subject: [PATCH 2/3] fix nojs themed comp display --- .../src/components/ThemedComponent/styles.module.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 69f32137af43..2802a0ed30ad 100644 --- a/packages/docusaurus-theme-common/src/components/ThemedComponent/styles.module.css +++ b/packages/docusaurus-theme-common/src/components/ThemedComponent/styles.module.css @@ -21,7 +21,6 @@ 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 */ - -:not[data-theme] .themedComponent--light { +:not([data-theme]) .themedComponent--light { display: initial; } From 82cf29937607fc6899eb3f64cc335b42ca60417a Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 18 Aug 2023 17:05:04 +0200 Subject: [PATCH 3/3] Fix bad CSS selector --- .../src/components/ThemedComponent/styles.module.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 2802a0ed30ad..e33167ae3d2e 100644 --- a/packages/docusaurus-theme-common/src/components/ThemedComponent/styles.module.css +++ b/packages/docusaurus-theme-common/src/components/ThemedComponent/styles.module.css @@ -21,6 +21,6 @@ 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 */ -:not([data-theme]) .themedComponent--light { +html:not([data-theme]) .themedComponent--light { display: initial; }