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.

How to import css correctly?

See original GitHub issue

I import the css using following code:

import 'inspire-tree/dist/inspire-tree.css';

but some errors occured because it can’t find the images. So how to import css correctly?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
viveleroicommented, Mar 28, 2017

I’m not sure that I’ve tested importing the compiled css into another webpack project but I don’t see any reason it wouldn’t work. It likely depends on how you’ve setup webpack. Our CSS is not distributed inline (with any js), it’s a separate css file with only one external GIF.

I have bundled the source SCSS in other webpack projects though, so I can say for sure that works, just needs something to compile it.

0reactions
geekpluxcommented, Mar 28, 2017

@viveleroi ok, great thanks. I fixed it by adding a loader for GIF. thank you.

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 Rule - W3Schools
The @import rule allows you to import a style sheet into another style sheet. The @import rule must be at the top of...
Read more >
Best way to include CSS? Why use @import? - Stack Overflow
The following are all correct ways to use @import @import url("fineprint.css") print; @import url("bluish.css") projection, tv; @import 'custom.css'; ...
Read more >
Using @import To Call Your CSS Files | Cascading Style Sheets
The easier way to apply multiple files is to use the "@import" rule (browser support dependant). In our example we import "main.css" which...
Read more >
External CSS Stylesheets – How to Link CSS to HTML and ...
If the CSS file and the HTML file are in different folders, you need to write the correct path that needs to go...
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