Skip to content

Commit 57432fc

Browse files
p-m-pclaude
andauthored
fix: preserve slide styles in tile effect transitions (#1015)
* fix: preserve slide styles in tile effect transitions Fix issue where tile effect transitions were removing all styles from slide elements. Now only removes the visibility property instead of clearing the entire style attribute, preserving custom styling. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * chore: add changeset for tile effect styles fix --------- Co-authored-by: Phil Parsons <p-m-p@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
1 parent ed5c59f commit 57432fc

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@boxslider/slider': minor
3+
---
4+
5+
Fix tile effect transitions preserving slide styles. Previously, tile effects were removing all styles from slide elements when cloning them for transitions. Now only the visibility property is removed, preserving any custom styling applied to slides.

packages/slider/src/effects/tile/fade-transition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class FadeTransition implements TileTransition {
6363

6464
setTileFace(slide: HTMLElement, tileFace: HTMLElement) {
6565
const clone = slide.cloneNode(true) as HTMLElement
66-
clone.removeAttribute('style')
66+
clone.style.removeProperty('visibility')
6767
tileFace.replaceChildren(clone)
6868
}
6969
}

packages/slider/src/effects/tile/flip-transition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class FlipTransition implements TileTransition {
8888

8989
setTileFace(slide: HTMLElement, tileFace: HTMLElement) {
9090
const clone = slide.cloneNode(true) as HTMLElement
91-
clone.removeAttribute('style')
91+
clone.style.removeProperty('visibility')
9292
tileFace.firstElementChild!.replaceChildren(clone)
9393
}
9494
}

0 commit comments

Comments
 (0)