Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#61808 closed defect (bug) (fixed)

Twenty Twelve: Code Block font family is different in the editor

Reported by: pitamdey Owned by: karmatosed
Priority: normal Milestone: 6.7
Component: Bundled Theme Version: 6.4
Severity: normal Keywords: has-screenshots has-patch needs-testing commit
Cc: Focuses: css

Description

In Twenty Twelve Theme, the Code block have a different font family in front-end and editor side.

I have checked the code and found that font-family: inherit is being applied on the editor side due to which issue may arise

Attachments (4)

Screenshot 2024-08-02 at 12.36.03 PM.png​ (170.1 KB ) - added by pitamdey 2 years ago.
Editor View
Screenshot 2024-08-02 at 12.36.48 PM.png​ (197.2 KB ) - added by pitamdey 2 years ago.
Frontend View
61808.patch​ (463 bytes ) - added by pitamdey 2 years ago.
After applying this solution the issue is resolved
61808.1.patch​ (455 bytes ) - added by sabernhardt 2 years ago.
sets font on .wp-block-code container

Download all attachments as: .zip

Change History (10)

@pitamdey
2 years ago

After applying this solution the issue is resolved

@sabernhardt
2 years ago

sets font on .wp-block-code container

#1 @sabernhardt
2 years ago

  • Focuses css added
  • Keywords has-patch added
  • Milestone Awaiting Review → Future Release
  • Summary Twenty Twelve : Code Block Font family is different in frontend and editor side → Twenty Twelve: Code Block font family is different in the editor
  • Version → 6.4

The iframe editor overrules the theme's font with Menlo (if available) in block-library/theme.css.

The inherit property for the code element would work if the correct font is set on .wp-block-code.

Last edited 2 years ago by sabernhardt (previous) (diff)

#2 @karmatosed
2 years ago

I am going to apply the testing keyword to get that happening and see about moving this through. Thank you everyone.

#3 @karmatosed
2 years ago

  • Keywords needs-testing added
  • Owner set to karmatosed
  • Status new → assigned

#4 @karmatosed
2 years ago

  • Keywords commit added

In testing I can confirm that this fixes the issue and now the font family is the same on both editors. I am going to progress this to commit. Thank you everyone.

#5 @karmatosed
2 years ago

  • Resolution → fixed
  • Status assigned → closed

In 58882:

Twenty Twelve: Fixes Code block font family difference in editors.

The Code block font family was different in the front-end and the editor. This resolves the overruling in the iframe editor.

Props pitamdey, sabernhardt.
Fixes #61808.

#6 @karmatosed
2 years ago

  • Milestone Future Release → 6.7
Note: See TracTickets for help on using tickets.