Make WordPress Core

#64041 closed defect (bug) (fixed)

Twenty Twelve: support Image block rounded style

Reported by: lancewillett Owned by: joedolson
Priority: normal Milestone: 6.9
Component: Bundled Theme Version: 6.6
Severity: normal Keywords: has-patch has-screenshots commit
Cc: Focuses: css

Description

Steps to reproduce

  1. Activate Twenty Twelve version 4.6
  2. Create a new post
  3. Add an "Image" block
  4. Upload an image
  5. In block settings, select "Rounded" under "Styles"

What I expected

For the rounded styles to apply both in the editor and on the front-end of the site.

What happened instead

Editor, yes. Front-end, no. Front-end shows square (default) styles.

Attachments (6)

64041.diff​ (324 bytes ) - added by lancewillett 13 months ago.
1 editor view.png​ (3.5 MB ) - added by lancewillett 13 months ago.
2 before patch.png​ (3.8 MB ) - added by lancewillett 13 months ago.
3 after patch.png​ (3.3 MB ) - added by lancewillett 13 months ago.
64041.1.diff​ (518 bytes ) - added by sabernhardt 13 months ago.
adds border-radius from WordPress 6.5 block-library styles in Twenty Twelve's blocks.css
Image block rounded style.png​ (2.7 MB ) - added by mukesh27 13 months ago.
Image block rounded style

Change History (17)

@lancewillett
13 months ago

This ticket was mentioned in ​Slack in #themes by lancewillett. ​View the logs.


13 months ago

This ticket was mentioned in ​PR #10042 on ​WordPress/wordpress-develop by ​@dhruvang21.


13 months ago
#2

@sabernhardt
13 months ago

adds border-radius from WordPress 6.5 block-library styles in Twenty Twelve's blocks.css

#3 @sabernhardt
13 months ago

  • Component Themes → Bundled Theme
  • Focuses css added
  • Milestone Awaiting Review → 6.9
  • Priority low → normal
  • Severity minor → normal
  • Version trunk → 6.6

The Rounded style had worked with WordPress 6.5, when the block-library stylesheet included

.wp-block-image .is-style-rounded img,
.wp-block-image.is-style-rounded img {
  border-radius: 9999px;
}

6.6 reduced the specificity to

:root :where(.wp-block-image.is-style-rounded img, .wp-block-image .is-style-rounded img) {
  border-radius: 9999px;
}

which is lower than img styles in Twenty Twelve's style.css:

.entry-content img,
.widget img {
	border-radius: 3px;
}

64041.1.diff​ copies the ​pixel-value radius ruleset from the older block-library styles to the theme, and block-related styles belong in blocks.css.

#4 @mukesh27
13 months ago

The 64041.1.diff​ working fine in my testing. See attached screenshot.

@mukesh27
13 months ago

Image block rounded style

#5 @mukesh27
13 months ago

  • Keywords has-screenshots commit added

​@mukesh27 commented on ​PR #10042:


13 months ago
#6

Thanks @dhruvang21.

The approach taken in https://core.trac.wordpress.org/attachment/ticket/64041/64041.1.diff is more appropriate then your so i'm going to close these PR.

#7 @rollybueno
13 months ago

Test Report

Description

This report validates whether the indicated patch works as expected.

Patch tested: https://core.trac.wordpress.org/attachment/ticket/64041/64041.1.diff

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.2.29
  • Server: nginx/1.29.1
  • Database: mysqli (Server: 8.4.6 / Client: mysqlnd 8.2.29)
  • Browser: Chrome 140.0.0.0
  • OS: Linux
  • Theme: Twenty Twelve 4.6
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Issue resolved with patch.

Additional Notes

  1. Switch your theme to Twenty Twelve 4.6.
  2. Create a brand-new post.
  3. Insert an Image block.
  4. Upload any image to the block.
  5. In the block settings sidebar, choose the Rounded style under Styles.

Supplemental Artifacts

Before patch:

  • Backend https://i.imgur.com/9Fi8jWb.png
  • Front-end https://i.imgur.com/CZVnmxl.png

After patch:

  • Front-end https://i.imgur.com/c4ykDX1.png

#8 @shailu25
13 months ago

Test Report

This Report Validates that the indicated patch address the issue.✅

Patch Tested: https://core.trac.wordpress.org/attachment/ticket/64041/64041.1.diff

Environment:

WordPress - 6.8.3
OS - Windows
Browser - Chrome
Theme: Twenty Twelve
PHP - 8.2.27
Plugin - None

Actual Results:

  • Issue Resolved with Patch ✅

Supplemental Artifacts

​@dhruvang21 commented on ​PR #10042:


13 months ago
#9

@mukeshpanchal27 can you reopen this PR as i could update the code with latest patch or should create a new PR?

#10 @joedolson
12 months ago

  • Owner set to joedolson
  • Status new → accepted

#11 @joedolson
12 months ago

  • Resolution → fixed
  • Status accepted → closed

In 61107:

Twenty Twelve: Restore support for Image block rounded style.

The specificity changes in core block-library styles in 6.6 caused the image block rounded style to have lower specificity than the theme stylesheet.

Add the radius ruleset from the block-library styles to Twenty Twelve to restore support.

Props lancewillett, sabernhardt, mukesh27, dhruvang21, rollybueno, shailu25, joedolson.
Fixes #64041.

Note: See TracTickets for help on using tickets.