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

Minor Social Block changes #67

Merged
merged 3 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
41 changes: 33 additions & 8 deletions blocks/social/social.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,31 @@
flex-direction: row;
gap: 1rem;
align-items: center;
margin-bottom: 1.5rem;

margin-bottom: 2rem;
}

main .section.social-container a {
color: var(--secondary);
}

main .section.social-container {
main .section.social-container h2 {
font-size: var(--heading-font-size-m);
margin-bottom: 1rem;
}

main .section.social-container .tag-name {
border: 1px solid var(--primary);
color: var(--primary);
font-size: var(--body-font-size-xs);
text-transform: uppercase;
padding: 0.25rem 0.5rem;
margin-bottom: 0.5rem;
}

main .section.narrow.social-container {
max-width: 45rem;
padding: 0 1rem;
margin: 0 auto;
margin-bottom: 7.5rem;
margin: 5rem auto;
}

main .section.social-container .section-container {
Expand All @@ -33,7 +45,7 @@ main .section.social-container p {
font-weight: var(--font-weight-medium);
font-size: var(--heading-font-size-m);
line-height: 1.3em;
margin: 2rem 0 1.5rem;
margin: 1rem 0;
}

.block.social>span {
Expand Down Expand Up @@ -65,13 +77,19 @@ main .section.social-container h1 + p {

main .section.social-container h4 {
color: var(--light-black);
margin-bottom: 0.5rem;
}

main .section.social-container .section-container ul {
margin-bottom: 1rem;
padding-inline-start: 2.5rem;
}

main .section.social-container .section-container ol {
margin-bottom: 1rem;
padding-inline-start: 2.5rem;
}

.social-container img {
width: 100%;
}
Expand All @@ -93,10 +111,14 @@ main .section.social-container .section-container ul {
div.social-container h3 {
font-weight: var(--font-weight-bold);
font-size: var(--heading-font-size-ms);
margin-bottom: 1.5rem;
margin-bottom: 1rem;
}

@media (min-width: 62rem) {
main .section.social-container.narrow {
max-width: 54.5rem;
jindaliiita marked this conversation as resolved.
Show resolved Hide resolved
}

main .section.social-container .section-container {
position: relative;
}
Expand All @@ -115,9 +137,12 @@ div.social-container h3 {
main .section.social-container h1 {
font-size: 2.25rem;
line-height: 1.3em;
margin: 5rem 0 2rem;
}

main .section.social-container h2 {
font-size: var(--heading-font-size-mxl);
}

.block.social {
flex-direction: column;
gap: 1rem;
Expand Down
10 changes: 10 additions & 0 deletions blocks/social/social.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,14 @@ export default async function decorate(block) {
spanWithImg.forEach((x) => {
block.appendChild(x);
});

const socialContainer = block.closest('.section.social-container>.section-container');
const firstP = socialContainer ? socialContainer.querySelector('p') : null;

if (firstP && firstP.nextElementSibling.tagName === 'H1') {
const innerSpan = document.createElement('span');
innerSpan.textContent = firstP.textContent;
innerSpan.classList.add('tag-name');
firstP.replaceWith(innerSpan);
}
}
1 change: 1 addition & 0 deletions tools/importer/import-news-press-healthythinking.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const addSocialBlock = (document) => {
});

const table = WebImporter.DOMUtils.createTable(cells, document);
socialShare.after(createSectionMetadata({ Style: 'Narrow' }, document));
socialShare.replaceWith(table);
}
}
Expand Down