question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CSS Import does not work as described in the documentation

See original GitHub issue

Checks

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

  1. npm i @splidejs/react-splide
  2. add line to import css to code
  3. build code

Expected Behaviour

the CSS to be imported without errors

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
NaotoshiFujitacommented, May 3, 2022

Then, you can directly import it from the dist directory like:

import '@splidejs/splide/dist/css/splide.min.css';
0reactions
j10sanderscommented, May 5, 2022

Then, you can directly import it from the dist directory like:

import '@splidejs/splide/dist/css/splide.min.css';

I was unable to run jest with import '@splidejs/react-splide/css/core' but this fixed it for me. Thanks!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found