addyosmani / addyosmani/critical

@import being removed entirely

Open
#456 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
10.3k
Forks
390
PR merge metrics
No merged PRs in 30d

Description

Hi there, I use `@import` for importing Adobe fonts to my site, however it appears that critical is removing my import statements in both the critical and uncritical CSS. Is there a way to keep it in?

Here's my gulp code:
```
const extractCriticalCSS = async () => {
return src('./dist/templates/**/*.html')
.pipe(flatmap((stream, file) => {
log("Extracting critical CSS for " + file.relative + "...");

const criticalPath = file.dirname + "/" + file.stem + "-critical.css";
const uncriticalPath = file.dirname + "/" + file.stem + ".css";

return stream
.pipe(critical({
inline: true,
base: './dist/',
target: {
css: criticalPath,
uncritical: uncriticalPath
},
extract: true,
ignore: {
atrule: ['@font-face']
}
}))
.on('error', err => {
log.error(err.message);
})
}))
.pipe(dest('./dist/templates'))
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.