Make WordPress Core

Opened 6 months ago

Closed 6 months ago

#61753 closed defect (bug) (fixed)

Twenty Eleven & Twenty Twelve: Code block does not adjust font size with block settings

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

Description

Hello Team,

I have reviewed "code" block on the twenty eleven & twenty twelve themes and found that the "typography" is not working when we trying to change it.

I already created the same issue for twenty thirteen theme: #61697

Here, I have provided its video and screenshot:

I think that it should be change based on selection.

Thanks,

Attachments (12)

twenty-eleven-code-block-editor-side.png (159.2 KB) - added by viralsampat 6 months ago.
Twenty-eleven editor side
twenty-eleven-code-block-front-end-side.png (107.7 KB) - added by viralsampat 6 months ago.
Twenty-eleven front-end side
twenty-twelve-code-block-editor-side.png (149.4 KB) - added by viralsampat 6 months ago.
Twenty-twelve editor side
twenty-twelve-code-block-front-end-side.png (112.7 KB) - added by viralsampat 6 months ago.
Twenty-twelve front-end side.
twenty-eleven-code-block-issue.mp4 (1.7 MB) - added by viralsampat 6 months ago.
Twenty-eleven issue vide:
twenty-twelve-code-block-issue.mp4 (821.5 KB) - added by viralsampat 6 months ago.
Twenty-twelve issue video:
61753.patch (1.8 KB) - added by sabernhardt 6 months ago.
inherit font size when code is inside pre
61753.2.patch (1.8 KB) - added by viralsampat 6 months ago.
I have checked above mentioned issue and I have resolved it and added patch. Also, I have attached screenshot after resolved this issue.
after-patch-twenty-eleven-code-block-editor-side.png (153.1 KB) - added by viralsampat 6 months ago.
After resolved issue twenty eleven editor
after-patch-twenty-eleven-code-block-front-end-side.png (134.0 KB) - added by viralsampat 6 months ago.
After resolved issue twenty eleven front-end
after-patch-twenty-twelve-code-block-editor-side.png (155.6 KB) - added by viralsampat 6 months ago.
After resolved issue twenty twelve editor
after-patch-twenty-twelve-code-block-front-end-side.png (159.4 KB) - added by viralsampat 6 months ago.
After resolved issue twenty twelve front-end.

Change History (19)

@viralsampat
6 months ago

Twenty-eleven editor side

@viralsampat
6 months ago

Twenty-eleven front-end side

@viralsampat
6 months ago

Twenty-twelve editor side

@viralsampat
6 months ago

Twenty-twelve front-end side.

@viralsampat
6 months ago

Twenty-eleven issue vide:

@viralsampat
6 months ago

Twenty-twelve issue video:

@sabernhardt
6 months ago

inherit font size when code is inside pre

#1 @sabernhardt
6 months ago

  • Keywords dev-feedback removed
  • Milestone changed from Awaiting Review to Future Release
  • Summary changed from The Code block does not adjust font size with block settings into the twenty-eleven & twenty-twelve themes. to Twenty Eleven & Twenty Twelve: Code block does not adjust font size with block settings
  • Version 6.6.1 deleted

As with Twenty Thirteen (#61697), Twenty Eleven and Twenty Twelve set the same font size for both the pre and code elements.

With 61753.patch, a code element would inherit the font size when it is nested inside a pre tag. In Twenty Twelve, this only applies within entry-content or comment-content; code in a widget honors the block's font size without any adjustment.

@viralsampat
6 months ago

I have checked above mentioned issue and I have resolved it and added patch. Also, I have attached screenshot after resolved this issue.

@viralsampat
6 months ago

After resolved issue twenty eleven editor

@viralsampat
6 months ago

After resolved issue twenty eleven front-end

@viralsampat
6 months ago

After resolved issue twenty twelve editor

@viralsampat
6 months ago

After resolved issue twenty twelve front-end.

#2 @sabernhardt
6 months ago

Both patches do basically the same thing, but

  1. these themes do not have an empty line between rulesets and
  2. 61753.patch adds font-size: inherit within the _existing_ ruleset for .entry-content pre code, .comment-content pre code in Twenty Twelve's style.css.

#3 @sabernhardt
6 months ago

Other themes: Twenty Fourteen through Twenty Twenty-Four already adjust the font size for Code blocks according to the block setting. Twenty Ten does not change, but that theme can have trouble with any font size adjustment due to pixel-based line-height values.

#4 @karmatosed
6 months ago

  • Keywords commit added
  • Milestone changed from Future Release to 6.7

Thank you everyone, I am going to assign this to myself to test with a look to then commit.

#5 @karmatosed
6 months ago

In this case I am looking to add the patch by @sabernhardt because it doesn't have extra lines that yours does @viralsampat. Those lines do not seem needed which means it's better to go with that one when both patches look the same.

This also has been noted as a difference:

61753.patch​ adds font-size: inherit within the _existing_ ruleset for .entry-content pre code, .comment-content pre code in Twenty Twelve's style.css.

I am going to go ahead and look to commit, both of you will get props though and both patches were the same in contents, just had some formatting differences.

Last edited 6 months ago by karmatosed (previous) (diff)

#6 @karmatosed
6 months ago

  • Keywords needs-testing removed

#7 @karmatosed
6 months ago

  • Owner set to karmatosed
  • Resolution set to fixed
  • Status changed from new to closed

In 58816:

Multiple themes: Fixes Code block not adjusting to font size changes.

This resolves the Code block not changing when the font sizes are switched in Twenty Eleven and Twenty Twelve. The solution is the same as used for other code block adjustments for font sizes.

Props viralsampat, sabernhardt.
Fixes #61753.

Note: See TracTickets for help on using tickets.