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

fix (accordion block): fix timeline block lines if inside accordion block #3293

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions src/block/accordion/frontend-accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ class StackableAccordion {
if ( el.getAttribute( 'id' ) ) {
elsAnchors[ el.getAttribute( 'id' ) ] = el
}

bfintal marked this conversation as resolved.
Show resolved Hide resolved
if ( el.contentEl.querySelector( '.stk-block-timeline' ) ) {
el.contentEl.classList.add( 'has-stk-block-timeline' )
}
el._StackableHasInitAccordion = true
}
} )
Expand Down
7 changes: 7 additions & 0 deletions src/block/accordion/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@
}
}

// the transform property causes the background-attachment: fixed to not work as expected.
// remove it to prevent timeline block lines to be glitchy.
// see similar issue: https://www.sitepoint.com/community/t/background-attachment-fixed-not-working-as-expected/35374/4
.stk-block-accordion__content.has-stk-block-timeline {
transform: initial;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we can start using :has() since it has been now implemented in Firefox!


// Accordion content shows up in the front end.
&:not([open]) .stk-block-accordion__content {
max-height: 0;
Expand Down
Loading