Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions packages/block-editor/src/components/image-editor/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// `wp-block-image` class prefixes are used for back compat.
// This component was previously in the block library package.
.wp-block-image__crop-area {
position: relative;
max-width: 100%;
width: 100%;
overflow: hidden;

// stylelint-disable selector-class-pattern -- react-easy-crop library class names.
.reactEasyCrop_Container {
// The linked Image block has `pointer-events: none` applied. Override it
// here to enable the crop action.
pointer-events: auto;

// This removes the border from the img within the image cropper so it
// can be applied to the cropper itself. This then allows the image to be
// cropped within the visual border providing more accurate editing and
// smoother UX.
.reactEasyCrop_Image {
border: none;
border-radius: 0; // Prevent's theme.json radius bleeding into cropper.
}
}

// stylelint-enable selector-class-pattern
}

.wp-block-image__zoom {
.components-popover__content {
min-width: 260px;
overflow: visible !important;
}
}
1 change: 1 addition & 0 deletions packages/block-editor/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
@use "./components/grid/style.scss" as *;
@use "./components/height-control/style.scss" as *;
@use "./components/iframe/style.scss" as *;
@use "./components/image-editor/style.scss" as *;
@use "./components/inserter-list-item/style.scss" as *;
@use "./components/inspector-controls/styles.scss" as *;
@use "./components/inspector-controls-tabs/style.scss" as *;
Expand Down
44 changes: 0 additions & 44 deletions packages/block-library/src/image/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -123,49 +123,6 @@ figure.wp-block-image:not(.wp-block) {
position: relative;
}

.wp-block-image__crop-area {
position: relative;
max-width: 100%;
width: 100%;
overflow: hidden;

// stylelint-disable selector-class-pattern -- react-easy-crop library class names.
.reactEasyCrop_Container {
// The linked Image block has `pointer-events: none` applied. Override it
// here to enable the crop action.
pointer-events: auto;

// This removes the border from the img within the image cropper so it
// can be applied to the cropper itself. This then allows the image to be
// cropped within the visual border providing more accurate editing and
// smoother UX.
.reactEasyCrop_Image {
border: none;
border-radius: 0; // Prevent's theme.json radius bleeding into cropper.
}
}
// stylelint-enable selector-class-pattern
}

.wp-block-image__crop-icon {
padding: 0 8px;
min-width: 48px;
display: flex;
justify-content: center;
align-items: center;

svg {
fill: currentColor;
}
}

.wp-block-image__zoom {
.components-popover__content {
min-width: 260px;
overflow: visible !important;
}
}

.wp-block-image__toolbar_content_textarea__container {
padding: $grid-unit;
}
Expand All @@ -174,4 +131,3 @@ figure.wp-block-image:not(.wp-block) {
// Corresponds to the size of the textarea in the block inspector.
width: 250px;
}

Loading