Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#61753 closed defect (bug) (fixed)

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

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

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 2 years ago.
Twenty-eleven editor side
twenty-eleven-code-block-front-end-side.png (107.7 KB ) - added by viralsampat 2 years ago.
Twenty-eleven front-end side
twenty-twelve-code-block-editor-side.png (149.4 KB ) - added by viralsampat 2 years ago.
Twenty-twelve editor side
twenty-twelve-code-block-front-end-side.png (112.7 KB ) - added by viralsampat 2 years ago.
Twenty-twelve front-end side.
twenty-eleven-code-block-issue.mp4 (1.7 MB ) - added by viralsampat 2 years ago.
Twenty-eleven issue vide:
twenty-twelve-code-block-issue.mp4 (821.5 KB ) - added by viralsampat 2 years ago.
Twenty-twelve issue video:
61753.patch (1.8 KB ) - added by sabernhardt 2 years ago.
inherit font size when code is inside pre
61753.2.patch (1.8 KB ) - added by viralsampat 2 years 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 2 years ago.
After resolved issue twenty eleven editor
after-patch-twenty-eleven-code-block-front-end-side.png (134.0 KB ) - added by viralsampat 2 years ago.
After resolved issue twenty eleven front-end
after-patch-twenty-twelve-code-block-editor-side.png (155.6 KB ) - added by viralsampat 2 years ago.
After resolved issue twenty twelve editor
after-patch-twenty-twelve-code-block-front-end-side.png (159.4 KB ) - added by viralsampat 2 years ago.
After resolved issue twenty twelve front-end.

Change History (19)

@viralsampat
2 years ago

Twenty-eleven editor side

@viralsampat
2 years ago

Twenty-eleven front-end side

@viralsampat
2 years ago

Twenty-twelve editor side

@viralsampat
2 years ago

Twenty-twelve front-end side.

@viralsampat
2 years ago

Twenty-eleven issue vide:

@viralsampat
2 years ago

Twenty-twelve issue video:

@sabernhardt
2 years ago

inherit font size when code is inside pre

#1 @sabernhardt
2 years ago

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

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
2 years 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
2 years ago

After resolved issue twenty eleven editor

@viralsampat
2 years ago

After resolved issue twenty eleven front-end

@viralsampat
2 years ago

After resolved issue twenty twelve editor

@viralsampat
2 years ago

After resolved issue twenty twelve front-end.

#2 @sabernhardt
2 years 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
2 years 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
2 years ago

  • Keywords commit added
  • Milestone Future Release6.7

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

#5 @karmatosed
2 years 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 2 years ago by karmatosed (previous) (diff)

#6 @karmatosed
2 years ago

  • Keywords needs-testing removed

#7 @karmatosed
2 years ago

  • Owner set to karmatosed
  • Resolutionfixed
  • Status newclosed

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.