Skip to content

Commit

Permalink
Link UI: polish lightbox pieces. (#58666)
Browse files Browse the repository at this point in the history
* Link UI: polish lightbox pieces.

* Polish info style

* Remove top margin from description

---------

Co-authored-by: Tetsuaki Hamano <[email protected]>
  • Loading branch information
jasmussen and t-hamano authored Feb 7, 2024
1 parent c8ddc57 commit 7472c0d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 27 deletions.
6 changes: 4 additions & 2 deletions packages/block-editor/src/components/url-input/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ $input-size: 300px;
width: $input-size;
}
padding: $input-padding;
border: none;
border-radius: 0;
margin-left: 0;
margin-right: 0;

&:not(:focus) {
border-color: transparent;
}

/* Fonts smaller than 16px causes mobile safari to zoom. */
font-size: $mobile-text-min-font-size;
@include break-small {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
__experimentalVStack as VStack,
} from '@wordpress/components';
import {
Icon,
link as linkIcon,
image,
page,
Expand Down Expand Up @@ -342,9 +343,7 @@ const ImageURLInputUI = ( {
) }
{ ! url && ! isEditingLink && lightboxEnabled && (
<div className="block-editor-url-popover__expand-on-click">
<div className="fullscreen-icon">
{ fullscreen }
</div>
<Icon icon={ fullscreen } />
<div className="text">
<p>{ __( 'Expand on click' ) }</p>
<p className="description">
Expand All @@ -355,7 +354,6 @@ const ImageURLInputUI = ( {
</div>
<Button
icon={ linkOff }
className="remove-link"
label={ __( 'Disable expand on click' ) }
onClick={ () => {
onSetLightbox( false );
Expand Down
30 changes: 9 additions & 21 deletions packages/block-editor/src/components/url-popover/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

.block-editor-url-popover__input-container {
padding: $grid-unit-10;
padding-left: $grid-unit-20;
}

.block-editor-url-popover__row {
Expand All @@ -17,7 +16,7 @@
// should take up as much space as possible.
.block-editor-url-popover__row > :not(.block-editor-url-popover__settings-toggle) {
flex-grow: 1;
gap: $grid-unit-05;
gap: $grid-unit-10;
}

.block-editor-url-popover__additional-controls .components-button.has-icon {
Expand Down Expand Up @@ -69,32 +68,21 @@
display: flex;
align-items: center;
min-width: $modal-min-width;
overflow: hidden;
white-space: nowrap;

.fullscreen-icon {
padding-right: $grid-unit-05;

> svg {
width: $icon-size;
height: $icon-size;
}
}

.text {
flex-grow: 1;

p {
margin: 0;
// This ensures the text and help text is 32px, which with
// padding makes the popover same height as the block toolbar.
line-height: $grid-unit-20;

&.description {
color: $gray-700;
font-size: $helptext-font-size;
}
}
}

.description {
color: $gray-600;
}

.remove-link {
margin-right: $grid-unit-10;
}

}

0 comments on commit 7472c0d

Please sign in to comment.