From b011e14993dcb4854d7c16c23de1b032263e9c6e Mon Sep 17 00:00:00 2001 From: Tomasz Kajtoch Date: Mon, 12 Feb 2024 16:23:22 +0100 Subject: [PATCH 1/2] fix(EuiPageTemplate): replace `CSS.escape` usage with string replace to fix SSR support when `CSS` utils are unavailable --- src/components/page_template/page_template.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/page_template/page_template.tsx b/src/components/page_template/page_template.tsx index e99361f7145..9f9b4b959f4 100644 --- a/src/components/page_template/page_template.tsx +++ b/src/components/page_template/page_template.tsx @@ -141,7 +141,7 @@ export const _EuiPageTemplate: FunctionComponent = ({ restrictWidth, paddingSize, // pageInnerId may contain colons that are parsed as pseudo-elements if not escaped - parent: `#${CSS.escape(pageInnerId)}`, + parent: `#${pageInnerId.replaceAll(':', '\\:')}`, }); const innerPanelled = () => panelled ?? Boolean(sidebar.length > 0); From a917692b2a5febe62bff20e1794347eebad613fd Mon Sep 17 00:00:00 2001 From: Tomasz Kajtoch Date: Mon, 12 Feb 2024 16:59:24 +0100 Subject: [PATCH 2/2] chore: add changelog --- changelogs/upcoming/7525.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelogs/upcoming/7525.md diff --git a/changelogs/upcoming/7525.md b/changelogs/upcoming/7525.md new file mode 100644 index 00000000000..7bbd4785cfb --- /dev/null +++ b/changelogs/upcoming/7525.md @@ -0,0 +1,3 @@ +**Bug fixes** + +- Fixed the `CSS is not defined` bug in `EuiPageTemplate` when rendering in some SSR environments, particularly Next.js v13 and up