Skip to content

Commit

Permalink
Merge pull request #120 from hlxsites/accordion
Browse files Browse the repository at this point in the history
92: Margin issue fixed for empty rows
  • Loading branch information
davenichols-DHLS authored Nov 14, 2023
2 parents b4076d3 + 8b4fb98 commit 779a4fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion blocks/accordion/accordion.css
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ main .expand-btn, .collapse-btn {
/* Tablet */
@media only screen and (min-width: 768px) {
main .accordion {
padding: 20px 0;
padding: 14px 0;
}

main .accordion.faq-accordion .faq-question {
Expand Down
5 changes: 5 additions & 0 deletions blocks/accordion/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ export default function decorate(block) {
});
}
const faqRows = [...block.children];
faqRows.forEach((ele) => {
if (ele.children[0].innerHTML === '') {
ele.remove();
}
});
faqRows.forEach((row) => {
const faqQuestion = [...row.children][0];
faqQuestion.classList.add('faq-question');
Expand Down

0 comments on commit 779a4fb

Please sign in to comment.