-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Try: Larger drag handles #10331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try: Larger drag handles #10331
Changes from 1 commit
d8acfdc
b02d52b
9091b5c
235e8dc
a7060ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| .block-library-spacer__resize-container.is-selected { | ||
| .block-library-spacer__resize-handler-top, | ||
| .block-library-spacer__resize-handler-bottom { | ||
| display: block; | ||
| } | ||
|
|
@@ -9,17 +8,32 @@ | |
| background: $light-gray-200; | ||
| } | ||
|
|
||
| .block-library-spacer__resize-handler-top, | ||
| .block-library-spacer__resize-handler-bottom { | ||
| display: none; | ||
| border-radius: 50%; | ||
| border: 2px solid $white; | ||
| width: 15px !important; | ||
| height: 15px !important; | ||
|
|
||
| // Make the container larger so there's a larger grabbable area | ||
| $resize-handler-container-size: $resize-handler-size + ($grid-size-small * 2); | ||
|
|
||
| // Offset the handle's position | ||
| position: absolute; | ||
| background: theme(primary); | ||
| left: calc(50% - #{$resize-handler-container-size / 2}) !important; | ||
| bottom: calc(#{$resize-handler-container-size / 2} * -1) !important; | ||
|
|
||
| // Apply the width/height of the container size plus padding so the handle | ||
| // sits in the middle of the grabbable area | ||
|
||
| width: $resize-handler-container-size !important; | ||
| height: $resize-handler-container-size !important; | ||
| padding: $grid-size-small; | ||
| } | ||
|
|
||
| .block-library-spacer__resize-handler-bottom::before { | ||
| display: block; | ||
| content: ""; | ||
| border: 2px solid $white; | ||
| border-radius: 50%; | ||
| width: $resize-handler-size !important; | ||
| height: $resize-handler-size !important; | ||
| padding: 0 3px 3px 0; | ||
| background: theme(primary); | ||
| cursor: se-resize; | ||
| left: 50% !important; | ||
| margin-left: -7.5px; | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!important😱For real though, why are these here? We shouldn't need them, and if we really do we should have comments.
(But we shouldn't need them 😄)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 on avoiding
!importantwhen we're able to. I see that there's an inline style that includes aleftrule. If possible could we try to update the related resizing JS to take this in account instead?Adding !important rules makes this incredibly difficult to override, folks that would like other styles, basically end up needing to add another !important rule, and hope that the rule is read last.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gwwar @tofumatt Agreed, but the resize component we're using here applies inline styles which we need to override. However I also see that they support a
styleprop so I'll see if I can just disable the inline styles.