Skip to content

Spacing becomes broken when slide's transition properties are set to a variable that is not defined during load #8136

@rptfrg

Description

@rptfrg

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/sandbox/swiper-navigation-forked-slrjkk

Bug description

Spacing becomes broken when slide's transition properties are set to a variable that is not defined during load.

How to reproduce:

  1. Set spaceBetween
  2. Set slide's transition CSS property to any variable, for example var(--animation)
  3. Make sure that variable is not immediately defined. It may be defined later on in a separate <style> block. (see the attached reproduction link)
  4. Scroll the slider to the end and notice that spacing is broken. (you will see what I mean)

Expected Behavior

Image

Actual Behavior

Image

Swiper version

12.0.3

Platform/Target and Browser Versions

Any browser

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions