From 3fafe8885611e3579496b8a0ebc6137513482585 Mon Sep 17 00:00:00 2001 From: Rich Tabor Date: Tue, 23 May 2023 09:03:07 -0400 Subject: [PATCH] Center vertically, improve interaction --- .../src/components/resizable-frame/index.js | 20 +++++++--- .../src/components/resizable-frame/style.scss | 38 ++++++++++--------- 2 files changed, 35 insertions(+), 23 deletions(-) diff --git a/packages/edit-site/src/components/resizable-frame/index.js b/packages/edit-site/src/components/resizable-frame/index.js index f5dff65f3749b5..5463cf357a31be 100644 --- a/packages/edit-site/src/components/resizable-frame/index.js +++ b/packages/edit-site/src/components/resizable-frame/index.js @@ -171,6 +171,18 @@ function ResizableFrame( { }, }; + const resizeHandleVariants = { + default: { + opacity: 1, + left: -16, + }, + resizing: { + opacity: 1, + left: -16, + scaleY: 1.3, + }, + }; + return ( ) : null, } } diff --git a/packages/edit-site/src/components/resizable-frame/style.scss b/packages/edit-site/src/components/resizable-frame/style.scss index 2bd478b9bf9916..9a959afe845e47 100644 --- a/packages/edit-site/src/components/resizable-frame/style.scss +++ b/packages/edit-site/src/components/resizable-frame/style.scss @@ -28,42 +28,44 @@ } .edit-site-resizable-frame__handle { - position: absolute; - width: 5px; - height: 50px; - background-color: rgba(255, 255, 255, 0.3); - z-index: 100; - border-radius: 5px; + align-items: center; + background-color: rgba($gray-700, 0.4); + border-radius: $grid-unit-05; cursor: col-resize; display: flex; - align-items: center; + height: $grid-unit-80; justify-content: flex-end; - top: 50%; + position: absolute; + top: calc(50% - #{$grid-unit-40}); + width: $grid-unit-05; + z-index: 100; + &::before { - position: absolute; - left: 100%; - height: 100%; - width: $grid-unit-30; content: ""; + height: 100%; + left: 100%; + position: absolute; + width: $grid-unit-40; } &::after { + content: ""; + height: 100%; position: absolute; right: 100%; - height: 100%; - width: $grid-unit-30; - content: ""; + width: $grid-unit-40; } - &:hover { + &:hover, + .is-resizing & { background-color: var(--wp-admin-theme-color); } .edit-site-resizable-frame__handle-label { - border-radius: 2px; background: var(--wp-admin-theme-color); - padding: 4px 8px; + border-radius: 2px; color: #fff; margin-right: $grid-unit-10; + padding: 4px 8px; } }