Make WordPress Core

Opened 11 months ago

Closed 5 months ago

#60560 closed defect (bug) (wontfix)

Twenty Nineteen: Group block font size is not applied to Pullquote

Reported by: nidhidhandhukiya's profile nidhidhandhukiya Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.4.3
Component: Bundled Theme Keywords: has-patch needs-testing close 2nd-opinion
Focuses: Cc:

Description

Steps to reproduce the issue :-

  1. Activate Twenty Ninteen theme.
  2. Choose Group block.
  3. Now take paragraph and pullquote block inside the group block.
  4. From group block settings change font size.

You can able to see the whatever font-size is taken that is applied to paragraph block but not applicable for pullquote block.

I have attached video for better understanding.
Video URL :- https://share.cleanshot.com/7YmTDzcSljsKzRtXLPpy

Attachments (2)

60560.patch (1.5 KB) - added by nidhidhandhukiya 11 months ago.
60560.1.patch (950 bytes) - added by nidhidhandhukiya 11 months ago.

Download all attachments as: .zip

Change History (8)

#1 @poena
11 months ago

  • Keywords changes-requested added

Hi
I can reproduce the bug also on WordPress 6.5 beta 1.

  • Twenty Nineteen uses SASS. Changes made directly to the css files will be overwritten when the scss files are built.
  • The default font size for the pullquote must be the same, even when it is placed inside a group. It should not inherit the group font size, unless the user changes the group font size.

#2 @poena
11 months ago

  • Summary changed from Twenty Ninteen - Group block settings not applied in pullquote. to Twenty Ninteen - Group block font size is not applied to pullquote.

#3 @nidhidhandhukiya
11 months ago

Hello @poena

As per your suggestion I have updated the scss file and as you mentioned that we have to update the font-size if that is given to group-block for that we need some specific class adds in wp-block-group class wherever we use custom-font-size.

Because, whenever we choose from the styles from the editor settings the class is added into the wp-block-group but if we applied the custom-font-size no class is added into the wp-block-group

I have prepared js for that this will add the class into the wp-block-group if custom font size is applied.

 // Get all elements with the class wp-block-group
  var elements = document.getElementsByClassName('wp-block-group');

  // Iterate over each element
  for (var i = 0; i < elements.length; i++) {
    // Get the style attribute value
    var styleAttribute = elements[i].getAttribute('style');

    // Check if the style attribute contains font-size
    if (styleAttribute && styleAttribute.includes('font-size')) {
      // Add the class has-custom-font-size
      elements[i].classList.add('has-custom-font-size');
    }
  }

According to me, If we get this class so we can able to update the css accordingly.

#4 @karmatosed
10 months ago

  • Keywords has-patch needs-testing added; changes-requested removed

#5 @sabernhardt
5 months ago

  • Keywords close 2nd-opinion added
  • Summary changed from Twenty Ninteen - Group block font size is not applied to pullquote. to Twenty Nineteen: Group block font size is not applied to Pullquote

I do not agree with inheriting font size from a Group (or Column) block for the Pullquote, even if the patch would check for a -font-size class or the font-size property in style.

The Pullquote block is designed to be larger than other paragraph text. Someone who sets a Group to the Large preset (or similar) may not want the Pullquote at twice the size, but someone who uses a smaller font size for the Group likely would want the Pullquote to be that much bigger. And anyone could be surprised by such a change when updating the theme. This is probably not a decision we should make for other people, especially after five years.

#6 @karmatosed
5 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

On reflection I would agree with you @sabernhardt. If we are changing something unexpectedly after so long it is something we should consider and weigh up, in this case it does seem like we should close. Thank you everyone.

Note: See TracTickets for help on using tickets.