diff --git a/pages/theming/global-theme-iframes-inner.page.tsx b/pages/theming/global-theme-iframes-inner.page.tsx new file mode 100644 index 0000000000..876550f393 --- /dev/null +++ b/pages/theming/global-theme-iframes-inner.page.tsx @@ -0,0 +1,23 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +import React, { useEffect } from 'react'; + +import { preset } from '~components/internal/generated/theming'; +import { applyGlobalTheme } from '~components/theming'; + +const colorProperty = preset.propertiesMap.colorTextAccent; + +export default function GlobalThemeIframesContentPage() { + useEffect(() => { + applyGlobalTheme(); + }, []); + + return ( +
+

Inner iframe

+ + Themed text + +
+ ); +} diff --git a/pages/theming/global-theme-iframes.page.tsx b/pages/theming/global-theme-iframes.page.tsx new file mode 100644 index 0000000000..ae3b35a323 --- /dev/null +++ b/pages/theming/global-theme-iframes.page.tsx @@ -0,0 +1,52 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +import React, { useState } from 'react'; + +import { setGlobalTheme, Theme } from '~components/theming'; + +const themeA: Theme = { + tokens: { + colorTextAccent: '#ff0000', + }, +}; + +const themeB: Theme = { + tokens: { + colorTextAccent: '#0000ff', + }, +}; + +export default function GlobalThemeIframesPage() { + const [themeApplied, setThemeApplied] = useState(null); + const iframeHref = window.location.href.replace('global-theme-iframes', 'global-theme-iframes-inner'); + + return ( +
+

Global Theme with Iframes

+ + {themeApplied ?? 'none'} + + + + +