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

Issue 960 allow accordions #381

Merged
merged 2 commits into from
May 13, 2024
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
19 changes: 14 additions & 5 deletions blocks/blog-left-nav/blog-left-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,28 @@ function anchorTagSocialMediaCreation(socialMedia) {

export default function decorate(block) {
// find the article content div
const articleContent = document.querySelector('.article-content');
const articleContent = document.querySelector('.tags-container');
articleContent.classList.add('article-content');
const contentDivs = articleContent.querySelectorAll(':scope > div');

const articleContentWrapper = createTag('div', { class: 'article-content-wrapper' });
const articleContentWrapper = createTag('div', {
class: 'article-content-wrapper',
});
contentDivs.forEach((div) => {
articleContentWrapper.append(div);
});

const articleMainWrapper = createTag('div', { class: 'article-main-wrapper' });
const articleMainWrapper = createTag('div', {
class: 'article-main-wrapper',
});
articleMainWrapper.append(block);
articleMainWrapper.append(articleContentWrapper);
articleContent.textContent = '';
articleContent.append(articleMainWrapper);

const blogContentLink = createTag('div', { class: 'blog-content-links' });
const blogContentLink = createTag('div', {
class: 'blog-content-links',
});
blogContentLink.setAttribute('id', 'blog-content-link');
block.textContent = '';
block.append(blogContentLink);
Expand All @@ -87,7 +94,9 @@ export default function decorate(block) {
});

const socialLinks = ['linkedin', 'twitter', 'facebook', 'share'];
const socialShareLinks = createTag('div', { class: 'social-share-links' });
const socialShareLinks = createTag('div', {
class: 'social-share-links',
});
socialShareLinks.setAttribute('id', 'social-share-links-id');

socialLinks.forEach((item) => {
Expand Down
4 changes: 4 additions & 0 deletions styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,10 @@ main .section > div:last-child {
padding-top: var(--spacer-element-05);
}

.section.article-content .article-main-wrapper .accordion {
margin-right: 0;
}

.columns.row-header div > div > h2,
.section.section-header > div:nth-child(1) > h1,
.section.section-header > div:nth-child(1) > h2 {
Expand Down
Loading