addyosmani/critical

Extract & Inline Critical-path CSS in HTML pages

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 16 minutes ago
Added to GitGenius on September 6th, 2026
Created on June 28th, 2014
Open Issues & Pull Requests: 37 (+0)
GitHub issues: Enabled
Number of forks: 390
Total Stargazers: 10,271 (+0)
Total Subscribers: 140 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 40.1 days
Mean response time: 305.0 days
90th percentile: 605.8 days
Tracked items: 19

How this project is maintained

Around half of the issues opened in the past year never receive a reply. Only 0% of issues opened in the past year have been closed. Three people close 92% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 8
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,336 days
Stale 30+ days: 8
Stale 90+ days: 7

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • enhancement (3)
  • awaiting reply (2)
  • bug (2)
  • help wanted (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

Critical is a tool that extracts and inlines above-the-fold CSS to eliminate render-blocking stylesheets and improve first paint performance.

The tool solves the problem of render-blocking CSS delaying first paint by identifying which styles are needed to paint content above the fold, inlining those rules into a style tag in the document head, and deferring the remaining stylesheets to load asynchronously after first paint. It works by either matching CSS rules against the delivered DOM for static content or by rendering the page in a real browser viewport to measure what actually paints above the fold. The output is deterministic, producing byte-identical results from the same input, making it safe for CI pipelines and version control.

The tool suits static site generators, server-rendered applications, multi-page applications, and single-page apps. It offers both a CLI and a programmatic API that returns results without writing to disk automatically. The automatic engine selection chooses between a fast static analysis mode for pre-rendered markup and a browser-based rendering mode for application shells, though either can be pinned explicitly. Unlike approaches that add inline scripts, Critical achieves its goal without violating strict Content Security Policies.

Development activity shows consistent engagement with the codebase through regular commits and updates to core functionality. The project maintains active issue triage and responds to user feedback. Documentation is comprehensive and kept current with examples and recipes for common use cases. The tool has been extended with an MCP server interface to support integration with coding agents, indicating ongoing evolution beyond traditional build pipeline usage.