coblocks icon indicating copy to clipboard operation
coblocks copied to clipboard

ISNBAT generate useless classes using Dimensions Control attributes

Open AnthonyLedesma opened this issue 6 years ago • 4 comments

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.

AnthonyLedesma avatar Oct 19 '19 00:10 AnthonyLedesma

https://github.com/godaddy/coblocks/pull/1032 should be merged before action is taken here.

AnthonyLedesma avatar Oct 21 '19 15:10 AnthonyLedesma

We may not need to handle this with our movement towards utility classes. Adding the "waiting" label until we decide this should be changed.

jrtashjian avatar Oct 21 '19 17:10 jrtashjian

Just confirming that this is still happening. We should remove these classes at somepoint but I'm keeping this as a low-priority issue.

jrtashjian avatar Jul 23 '20 20:07 jrtashjian

Reverted in #2153

olafleur-godaddy avatar Nov 15 '21 20:11 olafleur-godaddy