godaddy-wordpress / godaddy-wordpress/coblocks

ISNBAT generate useless classes using Dimensions Control attributes

Open
#1,036 4 comments 0 reactions 1 assignee Claimed by @snovosel View on GitHub
[Priority] Low [Type] Bug Good First Issue
Dominant language
JavaScript
Stars
794
Forks
142
PR merge metrics
No merged PRs in 30d

Description

**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:**
```javascript
[ `has-${ paddingSize }-padding` ]: paddingSize && ( paddingSize !== 'advanced' ),
```
**and**
```javascript
[ `has-${ paddingSize }-padding` ]: paddingSize && paddingSize !== 'advanced',
```

**as opposed to the format introduced in #1032**
```javascript
[ `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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.