coblocks
coblocks copied to clipboard
ISNBAT generate useless classes using Dimensions Control attributes
Describe the bug
#1032 reveals classnames are being applied to markup which are not being used for styling purposes. Implementing the logic used in #1032 across all blocks would prevent superfluous content from being entered into post content. The classes has-no-padding and has-no-margin are result of this bug. This change is primarily related to code quality.
The blocks Row, Column, Features, Feature, Media Card, and Hero make use of the following logic:
[ `has-${ paddingSize }-padding` ]: paddingSize && ( paddingSize !== 'advanced' ),
and
[ `has-${ paddingSize }-padding` ]: paddingSize && paddingSize !== 'advanced',
as opposed to the format introduced in #1032
[ `has-${ paddingSize }-padding` ]: paddingSize ( ! [ 'no', 'advanced' ].includes( marginSize ) ),
Impact of change This change would require new block deprecations or changes to deprecations as well save and edit functions.
https://github.com/godaddy/coblocks/pull/1032 should be merged before action is taken here.
We may not need to handle this with our movement towards utility classes. Adding the "waiting" label until we decide this should be changed.
Just confirming that this is still happening. We should remove these classes at somepoint but I'm keeping this as a low-priority issue.
Reverted in #2153