Skip to content

Commit

Permalink
Remove placeholder image icon and center text
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonjd committed Apr 14, 2024
1 parent 5696edf commit a492281
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,25 +139,25 @@ function InspectorImagePreview( { label, filename, url: imgUrl } ) {

return (
<ItemGroup as="span">
<HStack justify="flex-start" as="span">
<span
className={ classnames(
'block-editor-global-styles-background-panel__inspector-image-indicator-wrapper',
{
'has-image': imgUrl,
}
) }
aria-hidden
>
{ imgUrl && (
<HStack justify={ imgUrl ? 'flex-start' : 'center' } as="span">
{ imgUrl && (
<span
className={ classnames(
'block-editor-global-styles-background-panel__inspector-image-indicator-wrapper',
{
'has-image': imgUrl,
}
) }
aria-hidden
>
<span
className="block-editor-global-styles-background-panel__inspector-image-indicator"
style={ {
backgroundImage: `url(${ imgUrl })`,
} }
/>
) }
</span>
</span>
) }
<FlexItem as="span">
<Truncate
numberOfLines={ 1 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,11 @@
}

.block-editor-global-styles-background-panel__inspector-image-indicator-wrapper {
background: #fff linear-gradient(-45deg, transparent 48%, $gray-300 48%, $gray-300 52%, transparent 52%); // Show a diagonal line (crossed out) for empty background image.
border-radius: $radius-round !important; // Override the default border-radius inherited from FlexItem.
box-shadow: inset 0 0 0 $border-width rgba(0, 0, 0, 0.2);
display: block;
width: 20px;
height: 20px;
flex: none;

&.has-image {
background: #fff; // No diagonal line for non-empty background image. A background color is in use to account for partially transparent images.
}
background: #fff;
}

.block-editor-global-styles-background-panel__inspector-image-indicator {
Expand Down

0 comments on commit a492281

Please sign in to comment.