Skip to content

feat: add margin-auto button to spacing controls#152

Merged
tristan-mouchet merged 4 commits intodevelopfrom
feat/add-margin-auto-button
Apr 10, 2026
Merged

feat: add margin-auto button to spacing controls#152
tristan-mouchet merged 4 commits intodevelopfrom
feat/add-margin-auto-button

Conversation

@tristan-mouchet
Copy link
Copy Markdown
Collaborator

Summary

Add a "center block" button to the spacing settings panel that sets
margin-left: auto and margin-right: auto on the selected element,
enabling quick horizontal centering of block-level elements.

Original contribution by @harishkotra, refactored by @lunenas.

Changes

  • Add margin-auto button as a SettingsPanel action in SpacingControls
  • Wrap the MarginPadding visual control in a collapsible SettingsPanel
  • Add center-block icon to the Icon component
  • Bump version to 0.13.0

Test plan

  • Select a block element and click the center-block button in spacing settings
  • Verify margin-left and margin-right are both set to auto
  • Confirm the element centers horizontally within its parent
  • Verify the spacing panel collapses and expands correctly
  • Check the center-block icon renders properly at 12x12

liamwalder and others added 4 commits April 9, 2026 08:10
- Adds a quick-action button to center elements horizontally
- Button sets both marginLeft and marginRight to 'auto' simultaneously
- Includes helpful tooltip explaining the functionality
- Placed below the visual box editor for easy access
- Supports the same 'auto' value system already used in positioning controls

Resolves: github.com//issues/144
Move the center-block button from MarginPadding into SpacingControls
as a SettingsPanel action, and wrap spacing in a collapsible panel
consistent with SizingControls.

Made-with: Cursor
@tristan-mouchet tristan-mouchet added the Feature request A new feature request label Apr 10, 2026
@tristan-mouchet tristan-mouchet added the Feature request A new feature request label Apr 10, 2026
@tristan-mouchet tristan-mouchet self-assigned this Apr 10, 2026
@tristan-mouchet tristan-mouchet merged commit 1f021ef into develop Apr 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature request A new feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants