From 9fba3a7a9917d7f8d614135edfdeca231b6cc35b Mon Sep 17 00:00:00 2001 From: ShashiSubramanya Date: Wed, 13 May 2026 15:38:21 +0530 Subject: [PATCH 1/2] theme-builder fix and light/dark mode setting for in-product presentation --- src/assets/styles/index.scss | 23 ++++++++++++++++++++++- src/components/DevDocTemplate/index.tsx | 8 ++++++++ src/components/Document/index.tsx | 2 +- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 5e7c2cb77..baf0ec97c 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -1106,7 +1106,7 @@ a.anchor { box-shadow: 0 2px 2px #1B3E61; padding: 30px 0 0 40px; - + .header-banner-text { display: flex; flex-direction: column; @@ -1126,6 +1126,27 @@ a.anchor { } } +// In-product presentation only: override banner color to match product sidebar (#232F43). +// Standalone light/dark banner gradient is preserved via var(--header-banner-background) above. +.embedded-mode .header-banner { + background: #232F43; + box-shadow: none; +} + +// Fluid home page cards for both standalone and embedded presentations. +// Using flex shorthand so cards reflow naturally when the viewport or iframe width changes. +.introCard, +.boxHalfWidth { + flex: 1 1 260px; + width: auto; + max-width: 400px; +} + +.boxDiv { + flex: 1 1 220px; + width: auto; +} + .cardHeading { font-size: $font-size-h2; color: var(--primary-color) #1d232f; diff --git a/src/components/DevDocTemplate/index.tsx b/src/components/DevDocTemplate/index.tsx index 4edeaef04..97372e2b5 100644 --- a/src/components/DevDocTemplate/index.tsx +++ b/src/components/DevDocTemplate/index.tsx @@ -103,6 +103,8 @@ const DevDocTemplate: FC = (props) => { }); const [isDarkMode, setDarkMode] = useState(() => { if (typeof window === 'undefined') return false; + // In-product (embedded) presentation always uses light mode — product UI has no theme toggle. + if (!isPublicSite(location.search)) return false; /* themeMode is only written when the user explicitly clicks the toggle. If absent, follow OS preference fresh every load. */ const explicitChoice = localStorage.getItem('themeMode'); @@ -223,6 +225,12 @@ const DevDocTemplate: FC = (props) => { useEffect(() => { if (isBrowser()) { + // In-product (embedded) presentation always uses light mode. + if (!isPublicSiteOpen) { + setDarkMode(false); + setKey('dark'); + return; + } /* Correct SSR mismatch on first hydration */ const explicitChoice = localStorage.getItem('themeMode'); let isDark: boolean; diff --git a/src/components/Document/index.tsx b/src/components/Document/index.tsx index 4f2f32fb3..e77550308 100644 --- a/src/components/Document/index.tsx +++ b/src/components/Document/index.tsx @@ -137,7 +137,7 @@ const Document = (props: { pageid={props.pageid} /> )} - {!isHomePage && ( + {!isHomePage && props.isPublicSiteOpen && (
From 3e413b2f13f31a8433bc67b0ac58ecb3063d6ca8 Mon Sep 17 00:00:00 2001 From: ShashiSubramanya Date: Wed, 13 May 2026 16:42:59 +0530 Subject: [PATCH 2/2] CI check fix --- .../__snapshots__/index.test.tsx.snap | 62 ------------------- 1 file changed, 62 deletions(-) diff --git a/src/components/Document/__snapshots__/index.test.tsx.snap b/src/components/Document/__snapshots__/index.test.tsx.snap index 7331b4d67..9cd36ba70 100644 --- a/src/components/Document/__snapshots__/index.test.tsx.snap +++ b/src/components/Document/__snapshots__/index.test.tsx.snap @@ -6,68 +6,6 @@ exports[`Document should render correctly if isPublicSiteOpen is false 1`] = ` class="documentWrapper" style="width: 100%;" > -
-
- -
-