From de97d8fbdc4e7968be44096a30df055b5fb5f448 Mon Sep 17 00:00:00 2001 From: Oleg Isonen Date: Tue, 15 Nov 2022 22:25:41 +0100 Subject: [PATCH] remove ssr stylesheet from the page once we loaded a dynamic one on canvas --- apps/designer/app/canvas/shared/styles.ts | 11 +++++++++++ apps/designer/app/routes/$.tsx | 8 +++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/apps/designer/app/canvas/shared/styles.ts b/apps/designer/app/canvas/shared/styles.ts index 4e12c31cce..32706d46e4 100644 --- a/apps/designer/app/canvas/shared/styles.ts +++ b/apps/designer/app/canvas/shared/styles.ts @@ -9,6 +9,7 @@ import { toVarNamespace, } from "@webstudio-is/react-sdk"; import { globalCss } from "@webstudio-is/design-system"; +import { useEffect } from "react"; const setCssVar = (id: string, property: string, value?: StyleValue) => { const customProperty = `--${toVarNamespace(id, property)}`; @@ -47,6 +48,15 @@ const usePreviewStyle = () => { }); }; +// Once we rendered the tree in editing mode, we have rendered all styles in a