Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

fix: docked sidebar width (#9213)

David Luzard1112bbf4f39
diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx
index 15dabb5faa..8eb2a9e2cd 100644
--- a/packages/excalidraw/components/App.tsx
+++ b/packages/excalidraw/components/App.tsx
@@ -1550,6 +1550,7 @@ class App extends React.Component<AppProps, AppState> {
["--ui-pointerEvents" as any]: shouldBlockPointerEvents
? POINTER_EVENTS.disabled
: POINTER_EVENTS.enabled,
+ ["--right-sidebar-width" as any]: "302px",
}}
ref={this.excalidrawContainerRef}
onDrop={this.handleAppOnDrop}
diff --git a/packages/excalidraw/components/LayerUI.tsx b/packages/excalidraw/components/LayerUI.tsx
index ecd032bcd0..11914d09a8 100644
--- a/packages/excalidraw/components/LayerUI.tsx
+++ b/packages/excalidraw/components/LayerUI.tsx
@@ -526,7 +526,7 @@ const LayerUI = ({
appState.openSidebar &&
isSidebarDocked &&
device.editor.canFitSidebar
- ? { width: `calc(100% - var(--right-sidebar-width)px)` }
+ ? { width: `calc(100% - var(--right-sidebar-width))` }
: {}
}
>
diff --git a/packages/excalidraw/components/Sidebar/Sidebar.tsx b/packages/excalidraw/components/Sidebar/Sidebar.tsx
index ad6c9fe419..7c747d2f48 100644
--- a/packages/excalidraw/components/Sidebar/Sidebar.tsx
+++ b/packages/excalidraw/components/Sidebar/Sidebar.tsx
@@ -136,9 +136,6 @@ export const SidebarInner = forwardRef(
<Island
{...rest}
className={clsx("sidebar", { "sidebar--docked": docked }, className)}
- style={{
- "--right-sidebar-width": "302px",
- }}
ref={islandRef}
>
<SidebarPropsContext.Provider value={headerPropsRef.current}>