Skip to content

Commit

Permalink
Image block: refactor and remove data-wp-body (#58835)
Browse files Browse the repository at this point in the history
* First changes

* WIP

* Make it work

* Remove focustrap and use state for overlay styles

* Move resize to directive

* Move the scroll to a data-wp-on-window

* Remove lightbox object fit

* Add classes for e2e tests

* Small tweaks

* Don't use wp-lightbox-container in overlay figures

* Refactor the directive arguments

* More refactoring

* Remove the `data-wp-body` directive

* Update changelog

* Don't use wp_scripts_get_suffix() in Gutenberg

* Trigger setButtonStyles in resize

* Revert "Don't use wp_scripts_get_suffix() in Gutenberg"

This reverts commit 91c5635.

* Remove args passed to bind, class and style

* Final refactor

* Update changelog

* Revert unnecessary changes

* Replace contain with cover

* Make sure it doesn't fail when imageRef is not defined

* Fix buttonRef position

Co-authored-by: luisherranz <luisherranz@git.wordpress.org>
Co-authored-by: SantosGuillamot <santosguillamot@git.wordpress.org>
  • Loading branch information
3 people authored Feb 9, 2024
1 parent 3f761e3 commit 6af41df
Show file tree
Hide file tree
Showing 10 changed files with 435 additions and 793 deletions.
270 changes: 111 additions & 159 deletions packages/block-library/src/image/index.php

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/block-library/src/image/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
animation: both turn-on-visibility 0.35s;
}
}
&.hideanimationenabled {
&.show-closing-animation {
&:not(.active) {
animation: both turn-off-visibility 0.35s;
img {
Expand All @@ -327,7 +327,7 @@
animation: turn-on-visibility 0.4s forwards;
}
}
&.hideanimationenabled {
&.show-closing-animation {
&:not(.active) {
animation: none;
.lightbox-image-container {
Expand Down
Loading

0 comments on commit 6af41df

Please sign in to comment.