Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTL support #115

Merged
merged 7 commits into from
Nov 11, 2020
Merged

RTL support #115

merged 7 commits into from
Nov 11, 2020

Conversation

davidjerleke
Copy link
Owner

@davidjerleke davidjerleke commented Nov 9, 2020

RTL Support

This PR adds RTL support to Embla Carousel.

Usage

The options object is configured like so:

const emblaNode = document.getElementById('embla')
const options = { direction: 'rtl' } // Default is 'ltr'

const embla = EmblaCarousel(emblaNode, options)

The HTML direction also has to be set to RTL. This can be achieved by using the HTML dir attribute:

<div class="embla" id="embla" dir="rtl">
  ...
</div>

...or using the CSS direction property:

.embla {
  direction: rtl;
}

CodeSandbox

Try it out here.

@davidjerleke davidjerleke added the feature request New feature or request label Nov 9, 2020
@davidjerleke davidjerleke self-assigned this Nov 9, 2020
@davidjerleke davidjerleke linked an issue Nov 9, 2020 that may be closed by this pull request
@davidjerleke davidjerleke mentioned this pull request Nov 9, 2020
@davidjerleke davidjerleke merged commit f096d82 into master Nov 11, 2020
@davidjerleke davidjerleke added the resolved This issue is resolved label Nov 11, 2020
@davidjerleke davidjerleke deleted the feature/rtl-support branch November 11, 2020 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request resolved This issue is resolved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add RTL Support
1 participant