[wp-trac] [WordPress Trac] #60560: Twenty Ninteen - Group block font size is not applied to pullquote.
WordPress Trac
noreply at wordpress.org
Fri Feb 23 10:46:24 UTC 2024
#60560: Twenty Ninteen - Group block font size is not applied to pullquote.
-------------------------------+------------------------------
Reporter: nidhidhandhukiya | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bundled Theme | Version: 6.4.3
Severity: normal | Resolution:
Keywords: changes-requested | Focuses:
-------------------------------+------------------------------
Comment (by nidhidhandhukiya):
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.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60560#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list