magento / magento/security-package

Missing LESS guards create duplicate CSS

Open
#325 6 comments 0 reactions 1 assignee View on GitHub

@friendscottn is already working on this.

Since Jan 11, 2023.

Progress: PR created
Dominant language
PHP
Stars
75
Forks
73
PR merge metrics
No merged PRs in 30d

Description

### Preconditions (*)
1. Magento 2.4.5-p1 (not that this matters much)

### Steps to reproduce (*)
1. Compile the less files into CSS

### Expected result (*)
1. CSS should not be duplicated in styles-m.css and styles-l.css
2. CSS should be only in one CSS file or the other. This affects css file size and performance.

### Actual result (*)
1. Several style rules are duplicated between the two files:
```css
.form-discount .g-recaptcha {
margin-top: 50px !important;
}
...
.login-container .g-recaptcha,
.form-login .g-recaptcha,
.form-edit-account .g-recaptcha {
margin-bottom: 10px !important;
}
...
.required-captcha.checkbox {
position: absolute;
display: block;
visibility: visible;
overflow: hidden;
opacity: 0;
width: 1px;
height: 1px;
}
...
.block.newsletter .field-recaptcha .field .control:before {
content: none;
}
...
.review-form .field-recaptcha {
margin-bottom: 10px;
}
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.