How to use inline-critical - 2 common examples

To help you get started, we’ve selected a few inline-critical examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github addyosmani / critical / src / core.js View on Github external
function() {
      if (!this._uncritical) {
        this._uncritical = extractCss(orig, diff);
      }

      return this._uncritical;
    };
github addyosmani / smaller-pictures-app / gulpfile.babel.js View on Github external
gulp.task('inline-critical-css', () => {
  var html = fs.readFileSync('dist/index.html', 'utf8');
  var critical = fs.readFileSync('app/styles/app-shell.css', 'utf8');
  var inlined = inline(html, critical, {minify:true});
  fs.writeFile('dist/index.html', inlined.toString('utf-8'), 'utf8');
});

inline-critical

Inline critical-path css and load the existing stylesheets asynchronously

MIT
Latest version published 22 days ago

Package Health Score

78 / 100
Full package analysis

Popular inline-critical functions