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.

Including External CSS

See original GitHub issue

I’m having an issue and wondering if there’s a option in the configuration to address it. My component styles are maintained outside of the components and not directly imported by them (dir structure example below). For deploys, the styles are compiled separately and included in the document head.

My issue is: I can’t seem to instruct react-styleguidist to include them.

I’ve tried specifying a custom template that points to the built styles; however, all the paths I’ve tried return a 404 (can’t get the path right). If I can get that correct it would be a workable solution. I would lose file watching and reloading though.

Are there any other approaches I should look at?

src
 |- components
 |- styles
     |- index.css

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
sapegincommented, Apr 5, 2017

Have you tried this solution?

3reactions
dchamberscommented, Jul 27, 2017

Is there a way to import CSS directly into the index page without using a require as this doesn’t seem to be compatible with the webpack config used by create-react-app?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add CSS - W3Schools
External CSS. With an external style sheet, you can change the look of an entire website by changing just one file! Each HTML...
Read more >
External CSS Stylesheets – How to Link CSS to HTML and ...
It is considered a best practice to have your CSS stylesheets in an external file. So how can you link that CSS to...
Read more >
How to Include CSS in HTML Pages - Tutorial Republic
Including CSS in HTML Documents ; Inline styles — Using the style attribute in the HTML start tag. ; Embedded styles — Using...
Read more >
Attaching CSS to your document
The best method for attaching your CSS style sheets is to use external styles. With this method, you will write all your CSS...
Read more >
How to Link CSS to HTML Files in Web Development - Hostinger
How to Link CSS to HTML File Externally · rel – defines the relationship between the linked document and the current one. ·...
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