From e2d706ce8da84576ab48bfc4d42ffa86914c3b03 Mon Sep 17 00:00:00 2001 From: mxkae Date: Wed, 28 Aug 2024 09:10:08 +0800 Subject: [PATCH] use :has --- src/block/accordion/frontend-accordion.js | 3 --- src/block/accordion/style.scss | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/block/accordion/frontend-accordion.js b/src/block/accordion/frontend-accordion.js index 4af21e19f..5a7a2f32a 100644 --- a/src/block/accordion/frontend-accordion.js +++ b/src/block/accordion/frontend-accordion.js @@ -157,9 +157,6 @@ class StackableAccordion { elsAnchors[ el.getAttribute( 'id' ) ] = el } - if ( el.contentEl.querySelector( '.stk-block-timeline' ) ) { - el.contentEl.classList.add( 'has-stk-block-timeline' ) - } el._StackableHasInitAccordion = true } } ) diff --git a/src/block/accordion/style.scss b/src/block/accordion/style.scss index c656f5e31..7d6f7c8b7 100644 --- a/src/block/accordion/style.scss +++ b/src/block/accordion/style.scss @@ -89,7 +89,7 @@ // 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 { + .stk-block-accordion__content:has(.stk-block-timeline) { transform: initial; }