Skip to content

[Issue] Remove incorrect use important in swatches option text #30496

Closed
@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #30454: Remove incorrect use important in swatches option text


Preconditions (*)

Magrento 2.4-develop

Developers will not able re-define styles in swatch option text when core file defined important
Here is example

body .swatch-attribute .swatch-option.text.selected { background-color: black; }

property background-color will not able apply when core magento defined important. The last solution is use another important with high css specificity to get higher priority than magento

Steps to reproduce:

Scenario 1

1 .Create custom style less file for reproduce approach add style to swatch option text;
2. Path file can be app/design/frontend/Magento/blank/Magento_Swatches/web/css/source/_extend.less
3. In file _extend.less add style like description
ex:

body .swatch-attribute .swatch-option.text.selected { background-color: black; }
  1. Run cache clean and deploy static content
  2. Go to a category with a product on Storefront;

Actual Result: ✖️ Background color is still white

Peek 2020-10-15 09-45

Expected Result: ✔️ Background color is black

Peek 2020-10-15 09-47

Scenario 2
No customise styles
Swatch text option should show like before change

Expected Result:
Selected swatch option have background-color white

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

Metadata

Metadata

Assignees

Labels

Fixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P4No current plan to fix. Fixing can be deferred as a logical part of more important work.Progress: doneReported on 2.4.0Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S4Affects aesthetics, professional look and feel, “quality” or “usability”.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions