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.

Feature Request: inline import of css files

See original GitHub issue

It would be nice to have the ability import a .css file line (like .styl files are) rather than treating @import 'somefile.css' as literal CSS. Using --import-css is not a good solution as it affects all @import statements.

It seems like the most robust way to fix this would be for @import to resolve .css files in addition to .styl files. So if I specified @import 'normalize' and normalize.css exists (and normalize.styl does not), normalize.css would be imported inline.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:13
  • Comments:24 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
julmotcommented, Jun 27, 2017

Bump

5reactions
khalidhoffmancommented, Jan 10, 2017

Hey all. I seem to run into this issue quite frequently, so I wrote a small plugin to implement @require "file.css" as mentioned by some here. Feedback is always welcome! I’ve posted the repo on my github: https://github.com/khalidhoffman/stylus-require-css-evaluator

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 >
[Feature Request] Process/include inline CSS in index.html
It would be great if we had a feature that allows us to import CSS files right in the index.html, so the CSS...
Read more >
Best way to include CSS? Why use @import? - Stack Overflow
From a page speed standpoint, @import from a CSS file should almost never be used, as it can prevent stylesheets from being downloaded...
Read more >
CSS @import Rule - W3Schools
Import the "navigation.css" style sheet into the current style sheet: @import "navigation. · Import the "printstyle.css" style sheet ONLY if the media is...
Read more >
Basic Features: Built-in CSS Support - Next.js
In production, all CSS files will be automatically concatenated into a single minified .css file. Import styles from node_modules. Since Next.js 9.5.4, ...
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