Skip to content

Commit b5d0dad

Browse files
committed
remove computedstyle
1 parent 7012e61 commit b5d0dad

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/block/carousel/frontend-carousel.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,9 @@ class _StackableCarousel {
118118
} else if ( step === 2 ) {
119119
const numSlides = this.slideEls.length
120120
const slideClientRect = this.slideEls[ 0 ].getBoundingClientRect()
121-
const carouselSlideGap = window.getComputedStyle( this.el ).getPropertyValue( '--gap' )
122121
const slideWidth = slideClientRect.width
123122

124-
this.slideTranslateX = `calc((${ slideWidth }px * ${ numSlides }) + (${ carouselSlideGap } * ${ numSlides }))`
123+
this.slideTranslateX = `calc((${ slideWidth }px * ${ numSlides }) + (var(--gap) * ${ numSlides }))`
125124

126125
step++
127126
} else if ( step === 3 ) {

0 commit comments

Comments
 (0)