8000 [MWPW-173341] - Added ally fix for GNAV Promo heading text by Deva309 · Pull Request #4151 · adobecom/milo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[MWPW-173341] - Added ally fix for GNAV Promo heading text #4151

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

Merged
merged 4 commits into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions libs/blocks/global-navigation/utilities/menu/menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@
box-sizing: content-box;
}

.feds-promo-header {
margin: 0;
font-size: inherit;
line-height: inherit;
}

.feds-promo--dark {
background: var(--feds-background-promo--dark);
}
Expand Down
8 changes: 8 additions & 0 deletions libs/blocks/global-navigation/utilities/menu/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ const decorateGnavImage = (elem) => {
const decoratePromo = (elem, index) => {
const isDarkTheme = elem.matches('.dark');
const isImageOnly = elem.matches('.image-only');
const promoHeader = elem.querySelector('p > strong');
const imageElem = elem.querySelector('picture');

if (!isImageOnly) {
Expand All @@ -153,6 +154,13 @@ const decoratePromo = (elem, index) => {
content?.classList.add('feds-promo-content');
}

if (promoHeader?.textContent.trim()) {
const headingElem = toFragment`<h2 class="feds-promo-header">
${promoHeader.textContent.trim()}
</h2>`;
promoHeader.parentElement.replaceWith(headingElem);
}

decorateElements({ elem, className: 'feds-promo-link', index });

const decorateImage = () => {
Expand Down
Loading
0