Open mikeytown2 opened 6 years ago
Inline styles are currently not processed by critical so these imports are invisible to critical
.
You could work around this by specifying the imported stylesheets in the options like this:
critical.generate({
css: ['a.css', 'b.css', ...]
});
Even though inline-critical
won't process the inline styles either so you would end up with the critical css inlined alongside the inline styles with the @import
statements ;)
Why don't you use <link rel="stylesheet">
tags?
import can in in the CSS as well; this syntax just makes testing it a lot easier. What file would I need to edit in order to do a pull request for this feature? Could you point me the right direction?
The stylesheets are extracted with oust
You can find this in lib/core.js
.
The critical css is inlined with inline-critical
. So if you like you can prepare a PR on these two packages.
If you want to take this to the extreme make a webpage that uses this style for loading css
When running
critical https://import.css.url.com/
it'll spit out this "Error: css should not be empty" even though css files do exist.