forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to manually set image dimensions (WordPress#5812)
* Add ability to manually set image dimensions Let users manually set the width and height of an image either using a text field or by a preset percentage amount. * Reset image width and height when source type changes * Fix Safari misaligning width/height placeholders Setting an explicit line height on the width and height text fields prevents a small visual bug in Safari where the fields flicker when a number is typed in. * Fix paragraph and image inspector control margins - Fixes Reset button being too tall on mobile in the paragraph and image inspectors - Makes the margin at bottom of a <ButtonGroup> consistent with all other controls (1em) - Fix regression causing width and height fields from being too close to each other * Add explicit height to the editor image only The resizing tools we use size a parent div on the image. The height: auto responsive CSS we inherit from up higher messes with this. So this push adds an explicit 100% height on resized images. Co-authored-by: Joen Asmussen <[email protected]> * Add 'Image Dimensions' label above width and height controls * Don't set inline styles on an image's <figure> Let the <figure> get its width from the fit-content rule that was added in 2dc9fb3. * Update re-resizable to v4.4.8 * Rename blocks-image-dimensions → blocks-image__dimensions * Use class methods instead of calling setAttributes() directly * Add className prop to TextControl README * Reset any set image dimensions when image is changed If the user selects a new image, forget any image dimensions that they added since it likely no longer makes any sense.
- Loading branch information
1 parent
5709cfe
commit aded76a
Showing
10 changed files
with
143 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
.components-button-group { | ||
display: inline-block; | ||
margin-bottom: 20px; | ||
|
||
.components-button { | ||
border-radius: 0; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters