Skip to content

Fix toolbar layout: constant height and correct centering - #9

Merged
cafca merged 1 commit into
mainfrom
claude/sad-hellman
Apr 15, 2026
Merged

Fix toolbar layout: constant height and correct centering#9
cafca merged 1 commit into
mainfrom
claude/sad-hellman

Conversation

@cafca

@cafca cafca commented Apr 15, 2026

Copy link
Copy Markdown
Owner

What changed

  • Centering approach: replaced left: 50%; transform: translateX(-50%) with left: 24px; right: 24px; margin: 0 auto. The old approach clamped the element's width against the right viewport edge before the transform ran, causing the toolbar to shrink too early.
  • Width: switched to width: fit-content so the toolbar is exactly as wide as its content rather than capped at an arbitrary 720px.
  • Fixed height: added flex-shrink: 0 to .color-strip, .brush-controls, and .instructions so flex never compresses them — compression caused the instructions text to wrap to extra lines and grow the toolbar height.
  • Instructions text: forced a <br> so it's always exactly two lines, height stays constant.
  • Responsive breakpoint: instructions now hide at 800px instead of 640px, giving the controls room before the mobile layout kicks in.
  • Mobile paint toggle: lightened background from #9ca3af to #e5e7eb so it reads as a button without being so dark.

…eakpoints

- Replace left:50%/translateX(-50%) centering with left/right/margin:auto to
  avoid pre-transform width clamping against the viewport edge
- Use width:fit-content so the toolbar is exactly as wide as its content
- Add flex-shrink:0 to color strip, brush controls, and instructions to
  prevent compression that caused height growth on narrow viewports
- Force a line break in instructions text so it's always exactly two lines
- Hide instructions at 800px breakpoint (not 640px) to give controls room
- Lighten mobile paint-toggle background from #9ca3af to #e5e7eb
@cafca
cafca merged commit ff7e927 into main Apr 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant