Extracts and inlines critical-path CSS from HTML to improve page load performance.
Critical is a Node.js tool that extracts and inlines critical-path CSS from HTML pages. It identifies the CSS needed to render the above-the-fold content and either outputs it as a separate file or embeds it directly in the HTML, reducing render-blocking and improving page load performance.
Frontend developers and performance engineers working on web projects who want to optimize Core Web Vitals, particularly Largest Contentful Paint (LCP) and First Contentful Paint (FCP).
Developers choose Critical because it automates a complex performance optimization task, integrates easily into existing build pipelines, and provides fine-grained control over CSS extraction and inlining without manual effort.
Extract & Inline Critical-path CSS in HTML pages
Critical automatically identifies and extracts above-the-fold CSS from HTML, eliminating manual analysis, as highlighted in its core functionality of reducing render-blocking resources.
It allows inlining critical CSS directly into HTML or outputting separate files, with configurable settings for minification and asset handling, demonstrated in the 'inline' and 'target' options.
Supports generating critical CSS for multiple screen resolutions via the 'dimensions' option, ensuring optimized delivery across devices, as shown in the multi-resolution usage example.
Works seamlessly with Gulp, Grunt, Webpack, and CLI, with provided plugins and examples, making it easy to incorporate into existing development workflows.
The README admits that for sites with dynamically injected styles (common in Angular apps), accuracy may suffer, recommending direct use of Penthouse instead, indicating a gap in handling runtime CSS.
Using the 'extract' option creates unique CSS files per page, which can break caching benefits across a multi-page site, as noted in the documentation, potentially increasing load times for returning users.
Requires careful setup of numerous options like viewport dimensions, ignore rules, and asset rebasing, which can be error-prone and time-consuming, especially for developers new to performance optimization.
High performance and SEO friendly lazy loader for images (responsive and normal), iframes and more, that detects any visibility changes triggered through user interaction, CSS or JavaScript without configuration.
Generate critical css for your web pages
Finds the Above the Fold CSS for your page, and outputs it into a file
TMI (Too Many Images) - discover your image weight on the web
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.