Skip to content
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

MWPW-148439 - FIX - Text wraps under icon & No space between Icon and text in RTL Locale. #2343

Merged
merged 3 commits into from
Jun 3, 2024

Conversation

@sivasadobe sivasadobe requested review from elan-tbx and a team as code owners May 21, 2024 09:42
@sivasadobe sivasadobe added bug Something isn't working needs-verification PR requires E2E testing by a reviewer labels May 21, 2024
Copy link
Contributor

aem-code-sync bot commented May 21, 2024

Page Scores Audits Google
/drafts/siva/illustrator/free-trial-download?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Comment on lines 557 to 558
-moz-margin-end: 8px;
-webkit-margin-end:8px;
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the prefixes actually needed? Based on caniuse, the browser versions requiring them go back to 2018, we'd very likely have much bigger issues on those browsers than alignment :)

Screenshot 2024-05-21 at 17 53 40

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@overmyheadandbody
Make sense.
Prefix are removed.

Comment on lines +180 to +183
.icon-block .foreground .second-column .title-row {
display: flex;
align-items: center;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you're already using flex, couldn't a column-gap be used instead of the more complex margin logic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This code is primarily used to fix the text under the icon.
Yes, column-gap will solve this problem on pages written by ICON BLOCK. However, if RTL is enabled, it will not fix icon spacing on other pages.
The goal is to solve the no space problem on all milo pages. As a result, we changed the margin in icon.js to margin-inline, allowing the margin to be added based on direction.

Copy link
Contributor

This pull request is not passing all required checks. Please see this discussion for information on how to get all checks passing. Inconsistent checks can be manually retried. If a test absolutely can not pass for a good reason, please add a comment with an explanation to the PR.

libs/styles/styles.css Outdated Show resolved Hide resolved
@@ -70,7 +70,15 @@ function decorateContent(el) {
const textContent = el.querySelectorAll('.text-content > :not(.icon-area)');
const secondColumn = createTag('div', { class: 'second-column' });
textContent.forEach((content) => {
secondColumn.append(content);
let nodeToInsert = content;
const firstIcon = content.querySelector('.icon:first-child');
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to be sure: you're targeting the icon that is the first sibling within its parent, right? If it had a text before it (or any other element), this would no longer select it and apply the logic. Is that the expectation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we need to select the first icon of the space and move the child of its parent tag, only after that we can do the styling. If there is no icon at first, we don't need to do anything.

Co-authored-by: Rares Munteanu <[email protected]>
@spadmasa spadmasa added verified PR has been E2E tested by a reviewer Ready for Stage and removed needs-verification PR requires E2E testing by a reviewer labels Jun 3, 2024
@milo-pr-merge milo-pr-merge bot merged commit 2dcb91f into adobecom:stage Jun 3, 2024
13 checks passed
@milo-pr-merge milo-pr-merge bot mentioned this pull request Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Ready for Stage verified PR has been E2E tested by a reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants