CSS Import does not work as described in the documentation
See original GitHub issueChecks
- Not a duplicate.
- Not a question, feature request, or anything other than a bug report directly related to React Splide. Use Discussions for these topics: https://github.com/Splidejs/splide/discussions
Version
7.5.0
Description
the documentation tells you to import CSS this way:
import '@splidejs/react-splide/css';
However, this throws an error and when I look at the package in node_modules
, there is no top level “css” file or directory. The same issue exists in the main splide repo.
Reproduction Link
No response
Steps to Reproduce
npm i @splidejs/react-splide
- add line to import css to code
- build code
Expected Behaviour
the CSS to be imported without errors
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top Results From Across the Web
import - CSS: Cascading Style Sheets - MDN Web Docs
The @import CSS at-rule is used to import style rules from other valid stylesheets. An @import rule must be defined at the top...
Read more >CSS @import does not work with absolute paths ... - GitHub
CSS @import syntax only works with relative paths within the public directory. Anything else is a no-go. For example: Importing from ...
Read more >Next.js - import css file does not work - Stack Overflow
You can test that this is working by creating a simple page and importing some CSS. Start by creating a CSS file:
Read more >@import css not working | OutSystems
@import css not working · Open theme editor and click "Reset Theme Editor" · Create another theme (based on OutSystems UI) to do...
Read more >Using CSS Module Scripts to import stylesheets - web.dev
Learn how to use CSS module scripts to import CSS stylesheets using the same syntax as JavaScript modules.
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 Free
Top 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
Then, you can directly import it from the dist directory like:
I was unable to run jest with
import '@splidejs/react-splide/css/core'
but this fixed it for me. Thanks!