From e40d1cba95012fdabfea96cc4c854194ff92f7dd Mon Sep 17 00:00:00 2001 From: David Luzar <5153846+dwelle@users.noreply.github.com> Date: Thu, 24 Sep 2026 22:18:52 +0200 Subject: [PATCH] feat(editor): compact styles panel (#12163) * fix(editor): align buttons inflating styles panel intrinsic width The flex-wrap row break (zero-height flex-basis: 100% spacer) only breaks the line at layout time; for intrinsic sizing both rows were measured as a single line. Render the two rows as separate flex rows instead. Opus 5.5 (1M context), low * fix(editor): position range slider value label and track via CSS The label position and filled track were computed in JS from the input's offsetWidth, and only when the value changed, so they went stale when the container resized. Drive both from a --range-progress CSS variable, and drop the UA default inline margin that offset the track from the label. Opus 5.5 (1M context), low * feat(editor): compact styles panel Styles panel buttons are 32px regardless of screen size, rows are closer together, top-pick swatches are packed tighter, and the panel sizes to its content (up to the previous fixed width). Opus 5.5 (1M context), low * reduce large icon size on 1920px+ screens * fix color picker border color on mobile --- packages/excalidraw/components/Actions.scss | 14 ++++++ packages/excalidraw/components/Actions.tsx | 43 ++++++++----------- .../components/ColorPicker/ColorPicker.scss | 5 ++- packages/excalidraw/components/Range.scss | 16 ++++++- packages/excalidraw/components/Range.tsx | 34 +++------------ packages/excalidraw/css/styles.scss | 6 ++- packages/excalidraw/css/theme.scss | 4 +- packages/excalidraw/css/variables.module.scss | 4 +- 8 files changed, 64 insertions(+), 62 deletions(-) diff --git a/packages/excalidraw/components/Actions.scss b/packages/excalidraw/components/Actions.scss index f97f3c7b6f..26930a533f 100644 --- a/packages/excalidraw/components/Actions.scss +++ b/packages/excalidraw/components/Actions.scss @@ -92,6 +92,20 @@ } } +// two separate rows (rather than a flex-wrap row break) so the panel's +// intrinsic width is that of a single row +.align-buttons { + display: flex; + flex-direction: column; + gap: 0.5rem; + + &__row { + display: flex; + flex-wrap: wrap; + gap: 0.5rem; + } +} + .compact-shape-actions { display: flex; flex-direction: column; diff --git a/packages/excalidraw/components/Actions.tsx b/packages/excalidraw/components/Actions.tsx index b8a314d038..6e09452237 100644 --- a/packages/excalidraw/components/Actions.tsx +++ b/packages/excalidraw/components/Actions.tsx @@ -94,31 +94,24 @@ const AlignFieldset = ({ return (