Skip to content

containScroll: Take edge spacing into account #331

Closed
@davidjerleke

Description

Feature request is related to

  • embla-carousel (core package)

Describe the solution you'd like

When containScroll is active: Spacing (like margin) added to the first and the last slide with CSS will be accounted for, when calculating the scroll snap points. Currently, these spacings are ignored.

const embla = EmblaCarousel(rootNode, { containScroll: 'trimSnaps' })
.embla__slide:first-child {
  margin-left: 20px;
}

.embla__slide:last-child {
  margin-right: 20px;
}

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions