Make WordPress Core

Opened 2 months ago

Last modified 2 weeks ago

#60560 new defect (bug)

Twenty Ninteen - Group block font size is not applied to pullquote.

Reported by: nidhidhandhukiya's profile nidhidhandhukiya Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.4.3
Component: Bundled Theme Keywords: has-patch needs-testing
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 2 months ago.
60560.1.patch (950 bytes) - added by nidhidhandhukiya 2 months ago.

Download all attachments as: .zip

Change History (6)

#1 @poena
2 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
2 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
2 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
2 weeks ago

  • Keywords has-patch needs-testing added; changes-requested removed
Note: See TracTickets for help on using tickets.