Where should I import css? #6905
Unanswered
ShahriarKh
asked this question in
Q&A
Replies: 1 comment 2 replies
-
How about abstracting the swiper inside it's own component, and re-using that for each of your instances? Regarding the css, I did not notice any difference/ |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In a React project, I have many components across different pages that use Swiper, and I'm wondering if I should import the css files in the top-level layout file (Next js) so all pages and components have access to it; or import it in every component.
My main concern is the final bundle size and tree-shaking.
Which method do you recommend?
And is there a difference between css & scss if I don't want to modify the Swiper styles (and just import them)?
Beta Was this translation helpful? Give feedback.
All reactions