Skip to main content
100%

Gist 467901440093a9904541

✓ Published0🌍 Public
GGolodhros
Last edited Oct 11, 2015
Created on Oct 11, 2015

This example demonstrates a Gulp task that automates the generation of critical CSS for a WordPress theme. It shows the process of downloading a remote stylesheet, analyzing its rules, and extracting only the styles needed for above-the-fold rendering of a specific page. The task uses the `request` library to fetch the CSS file, `criticalcss` to parse and evaluate the rules against the target URL, and the Node.js `fs` module to write the resulting critical CSS to a local file.

AI-generated description

Similar vizzes