Make WordPress Core

Opened 3 weeks ago

Closed 3 weeks ago

Last modified 13 days ago

#61563 closed defect (bug) (fixed)

Twenty Fourteen: update styles for Table blocks and figure captions

Reported by: sabernhardt's profile sabernhardt Owned by: karmatosed's profile karmatosed
Milestone: 6.7 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch has-screenshots commit
Focuses: css Cc:

Description

The editor-blocks.css stylesheet used selectors with .editor-block-list__block, and its deprecation resulted in multiple discrepancies between the editor and the front end. #60293 reported the border color difference in tables, and r58399 matched the front end to the editor's incorrect border color (at a higher specificity). Differences that were not mentioned on #60293 include the 14px font size plus the header cells' alignment and letter case.

The figcaption element for multiple blocks also lacks its theme styles in the editor because wp-block-* classes do not begin the class list anymore.

Attachments (3)

61563.diff (2.9 KB) - added by sabernhardt 3 weeks ago.
2014-tables-screenshots.zip (1.1 MB) - added by sabernhardt 3 weeks ago.
screenshots with Table blocks in WordPress 6.5.5, 6.6-RC2, and with patch applied to 6.7-trunk-r58630
2014-tables-comparisons-with-patch.png (238.9 KB) - added by sabernhardt 3 weeks ago.
comparing Table blocks with patch applied (both front and editor) against the front end as it was in WordPress 6.5.5

Download all attachments as: .zip

Change History (11)

@sabernhardt
3 weeks ago

@sabernhardt
3 weeks ago

screenshots with Table blocks in WordPress 6.5.5, 6.6-RC2, and with patch applied to 6.7-trunk-r58630

@sabernhardt
3 weeks ago

comparing Table blocks with patch applied (both front and editor) against the front end as it was in WordPress 6.5.5

#1 @sabernhardt
3 weeks ago

61563.diff makes several changes:

  • Reduces specificity for the table cell border color and width (matching the 0-1-1 level it had had in Twenty Fourteen 3.9, but still excluding the Stripes style to honor the intent in r58399).
  • Removes the border color rules that match the border to the text when any color is selected (whether Text or Background, or possibly Border if/when appearance tools support is added).
  • Replaces .edit-post-visual-editor .editor-block-list__block with .editor-styles-wrapper in selectors so the font size plus the header cells' alignment and letter case can apply again.
  • Adds a [dir="rtl"] .editor-styles-wrapper table th selector so the header cell text alignment changes within the iframe.
  • Changes the border-collapse property to collapse so it matches the front (from block-library styles).
  • Moves the border styles to a separate ruleset with low specificity levels of 0-1-1 and 0-1-2, and the border rule is assigned in one line for the table and its cells together because the borders are collapsed.
  • Adds a [class*=" wp-block-"] figcaption selector so the caption styles apply in the editor.

#2 @sabernhardt
3 weeks ago

I forgot to add the blocks I tested.

#3 @sabernhardt
3 weeks ago

  • Milestone changed from Awaiting Review to Future Release

#4 @karmatosed
3 weeks ago

  • Keywords needs-testing added
  • Milestone changed from Future Release to 6.7
  • Owner set to karmatosed
  • Status changed from new to assigned

Thank you for this, it looks like a pretty solid candidate to test and see about getting through to commit so going to assign to myself with the view to do just that @sabernhardt.

#5 @karmatosed
3 weeks ago

  • Keywords commit added
  • Milestone 6.7 deleted
  • Resolution set to invalid
  • Status changed from assigned to closed

Adding commit as in testing I can confirm the same results as shared in screenshots. This therefore is ready to commit and as improves past commits should go in.

#6 @karmatosed
3 weeks ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

#7 @karmatosed
3 weeks ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 58686:

Twenty Fourteen: Updates styles for Table block and figure captions.

There were multiple discrepancies between the editor and front end with [58399] matched incorrect border color due to specificity. This resolves that and also includes issues not caught in [60293]. The full list of what this does is in ticket but a summary is reduces specificity for table cell border, removes border color rules, replaces selectors and adds wrapper so alignment changes within the iframe.

Props sabernhardt.
Fixes #61563.

#8 @sabernhardt
13 days ago

  • Keywords needs-testing removed
  • Milestone set to 6.7
Note: See TracTickets for help on using tickets.