VOTE: Opinion wanted before release of v.3!
See original GitHub issueQuestion: Should Embla Carousel be responsible for toggling classnames out of the box or should this be up to the user to implement?
WIth Embla v.3 this is easily achieved like so:
const embla = EmblaCarousel(emblaNode, { loop:false })
const selectedClass = 'is-selected'
const draggableClass = 'is-draggable'
const draggingClass = 'is-dragging'
function applyDraggableClasses() {
emblaNode.classList.add(draggableClass)
embla.on('pointerDown', () => emblaNode.classList.add(draggingClass))
embla.on('pointerUp', () => emblaNode.classList.remove(draggingClass))
}
function applySelectedClasses() {
const slidesInView = embla.slidesInView(true)
const slidesNotInView = embla.slidesNotInView(true)
slidesNotInView.forEach(i => slides[i].classList.remove(selectedClass))
slidesInView.forEach(i => slides[i].classList.add(selectedClass))
}
applyDraggableClasses()
embla.on('select', applySelectedClasses)
embla.on('pointerUp', applySelectedClasses)
embla.on('init', applySelectedClasses)
Basically, this suggestion is about deprecating the following options:
Voting closed! Embla v.3 will still support all these options.
👍 = Keep these options
👎 = Remove these options
I’m going to throw out random pings to get this started. I hope you don’t mind.
@gunnarx2, @xiel, @olushchik, @nikrowell, @yocmen, @LaksCastro, @bitttttten, @mrksmts, @jakubreron, @iamkevingreen, @niubsta, @michaelrambeau, @omarkhatibco, @readeral, @allen-garvey, @ontrigger.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:11 (7 by maintainers)
Top Results From Across the Web
About Section 5 Of The Voting Rights Act - Department of Justice
The Shelby County decision. On June 25, 2013, the United States Supreme Court held that it is unconstitutional to use the coverage formula...
Read more >Know Your Rights | Voting Rights
What are my general rights on Election Day? The poll worker says my name is not on the list of registered voters; I...
Read more >Voting Rights Act (1965) | National Archives
EnlargeDownload Link Citation: An act to enforce the fifteenth amendment to the Constitution of the United States and for other purposes, ...
Read more >Rock the Vote - Register to Vote, Find Election Info, and More!
Dedicated to building the political power of young people. Register to vote, check your registration status, and more. Fast, easy, secure, nonpartisan.
Read more >Election Security Rumor vs. Reality - CISA
When a ballot cannot be read by a scanner at a voting site, election officials apply procedures to securely store the ballots until...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you all for voting! Embla will still support the class name toggling in v.3 with one addition: The possibility to opt-out by passing empty strings as classnames for all these options.
Stay tuned for Embla Carousel version 3!
Hit the watch button to get notified about the release 📣.
@davidcetinkaya I would like to keep the classNames since I using it every time to style my slider.
I know I can easily implement it but it’s overhead to do the same code every time you need to use the slider.