Skip to content

Negative margin in dimension controls #32644

Description

@carolinan

What problem does this address?

It is not possible to use negative margins in the margin control.

What is your proposed solution?

If negative margins were allowed, designers could overlap blocks easier without having to create custom block styles.
This would also open up for more varied block patterns -the block pattern directory can not use custom block styles.

Activity

  1. thirumani02 commented on Aug 10, 2021

    @thirumani02

    Actually you can do it by passing min prop.
    for ex.

    <BoxControl
        label={__('Margin')}
        onChange={(value) => console.log(value)}
        inputProps={{ min: -300 }}
    />
    

    It is not explained in Readme but i can able to find it when searching inside core files

  2. timsinc commented on Jan 17, 2022

    @timsinc

    Does anyone know if there are plans to implement this? Negative margins are a very common and useful layout tool that seems should be enabled by default for the core margin control.

  3. aurooba commented on Jan 23, 2022

    @aurooba
    Member

    Hallo! Trying to work with FSE and this is a serious serious oversight. We need to be able to set negative margins, it's a very common technique.

  4. carolinan commented on Feb 7, 2022

    @carolinan
    ContributorAuthor

    I am not sure how this would affect the blockgap?

  5. mrfoxtalbot commented on Feb 7, 2022

    @mrfoxtalbot

    +1 to adding negative margins. I just found a case in the wild where this would have been very useful.

  6. timsinc commented on Feb 7, 2022

    @timsinc

    I am not sure how this would affect the blockgap?

    I believe a negative margin value would affect the blockgap just like a positive margin does and override the blockgap css for that particular block.

  7. daviedR commented on Feb 8, 2022

    @daviedR
    Contributor

    +1

    Negative margin is essential for design and layout building

  8. samxmunoz commented on Apr 12, 2022

    @samxmunoz

    +1

    Negative margin allowing for overlapping elements is essential.

  9. rolf-yoast commented on Apr 13, 2022

    @rolf-yoast

    +1

    I need it for a design I'm currently building.

  10. aristath commented on Apr 28, 2022

    @aristath
    Member

    Reopening this one because #40464 is getting reverted.

  11. 61 remaining items

  12. moved this from Next to Later in Design prioritieson Jan 15, 2024
  13. flabernardez commented on Jan 24, 2024

    @flabernardez

    Need it! Please! Now I'm adding it with a css class 😔

  14. alperta commented on Feb 10, 2024

    @alperta

    +1 so that we don't need to write custom css classes.

  15. wpsoul commented on Feb 27, 2024

    @wpsoul

    OMG, it still doesn't have negative margin?

  16. DevAndreyBilchenko commented on Feb 29, 2024

    @DevAndreyBilchenko

    +1 topic started from 2021

  17. changed the title [-]Feature request: Allow negative margins in controls[/-] [+]Negative margin in dimension controls[/+] on Mar 21, 2024
  18. SH4LIN commented on Mar 28, 2024

    @SH4LIN
    Contributor

    +1

  19. lunule commented on Mar 28, 2024

    @lunule

    +1

  20. cloudcreationsjess commented on Mar 29, 2024

    @cloudcreationsjess

    +1

  21. moved this from Later to Next in Design prioritieson Apr 3, 2024
  22. annezazu commented on Apr 3, 2024

    @annezazu
    Contributor

    As this is being explored in this initial PR (#60347), I want to share some UX considerations. Specifically, I want to note that there needs to be a pause/stop point before going to negative values when using either the slider or the ability to drag up/down to change controls as shown below:

    negative.margin.mp4

    Right now, with the current PR that is meant to be a small start towards solving this, you can quickly slide past the 0 and it would go a long way to have a "sticky" point at 0 as it's a common action to try to 0 out values to reset something. I'm aware, I can go to the three dot menu to reset but this would keep the more visible options useful to reset while also allowing new functionality.

  23. moved this from Next to Now in Design prioritieson Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Needs Design FeedbackNeeds general design feedback.[Feature] Design ToolsTools that impact the appearance of blocks both to expand the number of tools and improve the experi[Feature] LayoutLayout block support, its UI controls, and style output.[Type] EnhancementA suggestion for improvement.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions