Skip to content

Remove incorrect use important in swatches option text #30454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

mrtuvn
Copy link
Contributor

@mrtuvn mrtuvn commented Oct 12, 2020

Description (*)

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

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#<issue_number>

Manual testing scenarios (*)

Scenario 1
Have customise styles for blank theme

  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; }
  4. Run cache clean and deploy static content
  5. Check frontend in details product page. Visit any configurable product have swatch option text to easier see the change
  6. If product have swatch option text when user select swatch option the background would change to black
    But it's not happen because core define important override define in _extend.less
  7. Expected result is the background-color in _extend.less should be applied and have higher priority than default magento
    Default magento is .swatch-option.text.selected {background-color: #ffffff !important} background color white will have high priority than other declare

Before change results: Background-color: black not apply, still have background color white in swatch-option selected
After change results: Background-color: black applied

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

After results: remain visual same as before
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)

Resolved issues:

  1. resolves [Issue] Remove incorrect use important in swatches option text #30496: Remove incorrect use important in swatches option text

@m2-assistant
Copy link

m2-assistant bot commented Oct 12, 2020

Hi @mrtuvn. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@mrtuvn mrtuvn force-pushed the remove-incorrect-use-important-declare-swatches branch from 376964b to df5ae12 Compare October 12, 2020 15:13
@@ -326,7 +326,6 @@
margin: 2px 0;
padding: 2px;
position: static;
z-index: 1;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unneccesary define z-index

@sidolov sidolov added Priority: P4 No current plan to fix. Fixing can be deferred as a logical part of more important work. Severity: S4 Affects aesthetics, professional look and feel, “quality” or “usability”. labels Oct 12, 2020
Copy link
Contributor

@ptylek ptylek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrtuvn Can you please add manual testing scenarios so QA can check if selected styling for swatch option text works properly after the change? Looks ok, but would wait for static tests to complete.

@mrtuvn
Copy link
Contributor Author

mrtuvn commented Oct 13, 2020

i have updated manual testing scenarios

@ptylek
Copy link
Contributor

ptylek commented Oct 13, 2020

@magento run Static Tests

@mrtuvn
Copy link
Contributor Author

mrtuvn commented Oct 13, 2020

@magento run Database Compare, Functional Tests CE, Functional Tests EE, Functional Tests B2B, Integration Tests, Magento Health Index, Sample Data Tests CE, Sample Data Tests EE, Sample Data Tests B2B, Unit Tests, WebAPI Tests

@mrtuvn
Copy link
Contributor Author

mrtuvn commented Oct 13, 2020

@magento run Semantic Version Checker

Copy link
Contributor

@ptylek ptylek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mrtuvn. Needs manual testing to check if selected styling for swatch option text stays the same as before change.

@ptylek ptylek added the Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests label Oct 14, 2020
@magento-engcom-team
Copy link
Contributor

Hi @ptylek, thank you for the review.
ENGCOM-8341 has been created to process this Pull Request
✳️ @ptylek, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@engcom-Alfa engcom-Alfa self-assigned this Oct 15, 2020
@engcom-Alfa
Copy link
Contributor

engcom-Alfa commented Oct 15, 2020

✔️ QA Passed

Manual testing scenario:

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;

Before: ✖️ Background color is still white

Peek 2020-10-15 09-45

After: ✔️ Background color is black

Peek 2020-10-15 09-47

Scenario 2

No customise styles

After: ✔️ Selected swatch option have background-color white

Peek 2020-10-15 10-36

Checked and on the Blank theme and everything works as expected

After: ✔️ Background color is black

Peek 2020-10-15 11-00

@engcom-Alfa
Copy link
Contributor

@magento create issue

@m2-assistant
Copy link

m2-assistant bot commented Oct 16, 2020

Hi @mrtuvn, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@mrtuvn mrtuvn deleted the remove-incorrect-use-important-declare-swatches branch October 24, 2020 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Design/Frontend Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests Priority: P4 No current plan to fix. Fixing can be deferred as a logical part of more important work. Progress: accept QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S4 Affects aesthetics, professional look and feel, “quality” or “usability”.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Issue] Remove incorrect use important in swatches option text
6 participants