Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image block box-shadows conflict with border-radius #57611

Closed
kaelansmith opened this issue Jan 5, 2024 · 2 comments
Closed

Image block box-shadows conflict with border-radius #57611

kaelansmith opened this issue Jan 5, 2024 · 2 comments
Labels
[Block] Image Affects the Image Block [Package] Style Engine /packages/style-engine [Type] Bug An existing feature does not function as intended

Comments

@kaelansmith
Copy link

Description

I'm using the relatively new "shadows" option in theme.json, created some shadow presets, and tried applying a default shadow to image blocks via theme.json > styles > blocks > core/image > shadow, where I also specify a default border-radius, and found that the shadow gets applied to the wrapping figure element, while the border-radius gets applied to the nested img element, which causes a visual issue where the shadow isn't "in sync" with the border radius -- screenshot (most noticeable on bottom corners):

image

Code:

{
  ...
  "styles": {
    "blocks": {
      "core/image": {
        "border": {
          "radius": "var(--wp--custom--border-radius--lg)"
        },
        "shadow": "var(--wp--preset--shadow--md)",
      }
    }
  }
}

Work-around:

{
  ...
  "styles": {
    "blocks": {
      "core/image": {
        "border": {
          "radius": "var(--wp--custom--border-radius--lg)"
        },
        "css": "& img{box-shadow:var(--wp--preset--shadow--md);}"
      }
    }
  }
}

Step-by-step reproduction instructions

  1. apply provided code example in your own theme.json

Screenshots, screen recording, code snippet

No response

Environment info

WP v6.4.2, not using Gutenberg plugin

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@kaelansmith kaelansmith added the [Type] Bug An existing feature does not function as intended label Jan 5, 2024
@jordesign jordesign added [Block] Image Affects the Image Block [Package] Style Engine /packages/style-engine labels Jan 7, 2024
@colinduwe
Copy link
Contributor

I tested this and confirmed the issue when not using the Gutenberg plugin. Installing and activating the Gutenberg 17.8.2 resolves the issue.

@madhusudhand
Copy link
Contributor

Thank you @colinduwe for testing. I can also confirm that it is no longer an issue.

image

Closing the issue. If you still observe the issue, please re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Image Affects the Image Block [Package] Style Engine /packages/style-engine [Type] Bug An existing feature does not function as intended
4 participants