Open primozpadar opened 1 year ago
Example how this can be achieved with css variables:
function handleMouseDown() { document.addEventListener("mousemove", handleMouseMove); document.addEventListener("mouseup", handleMouseUp, { once: true }); } function handleMouseMove(e) { const width = Math.max(MIN_WIDTH, e.screenX); document.documentElement.style.setProperty("--editor-width", `${width}px`); } function handleMouseUp() { document.removeEventListener("mousemove", handleMouseMove); }
And add --editor-width to the css root
--editor-width
:root { --editor-width: 300px; }
Example how this can be achieved with css variables:
And add
--editor-width
to the css root