swiper
swiper copied to clipboard
core modules + modules injectStylesUrls
@nolimits4web first of all, thanks for creating the wonderful library.
In a project, we're trying to migrate from Swiper React to Elements, and I second @awacode21 comments, the documentation does not provide enough clarity on what to do. My code is almost exactly as documented here but this part of the documentation is a bit vague:
we also need to add modules styles globally and also inject modules styles to the shadow DOM
Does "add modules styles globally" mean
import "swiper/element/css/pagination"in the context of a React app?Does "inject modules styles to the shadow DOM" mean
injectStylesUrls: ["swiper/element/css/pagination"]?If not, how can we inject the existing styles provided by the package (i.e. stylesheets that already exist like
node_modules/swiper/modules/pagination-element.min.css)?Thanks for the response.
Originally posted by @arman-h in #7485
#7485 #issuecomment-2933800992
If you're using Vite, please read comment above.
If not, you may have to read your bundler's document for assets handling reference.