# addyosmani/critical

Extract & Inline Critical-path CSS in HTML pages

Repository: https://github.com/addyosmani/critical
Canonical: https://ross.abutalabs.com/products/critical
Language: JavaScript
License: Apache-2.0
License Family: permissive
Topics: css, critical-css, critical-path-css, critical-path-styles, inline-css, inline-styles
Last push: 2026-08-03T08:22:27+00:00

## Health v2 (maintenance only)
Score: 81/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 95, release rhythm 52, longevity 100
- inputs: {"age_days": 4449, "days_push": 30, "days_rel": 108, "gap_med": 600, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 10265, forks 389 (observed 2026-08-28T04:10:41.378637+00:00)

## What it is
A Node.js tool that extracts above-the-fold (critical-path) CSS from HTML pages, inlines it into the document head, and asynchronously loads the remaining stylesheets to eliminate render-blocking CSS. It offers both a CLI and a JavaScript API, with two extraction engines (DOM-based and browser-rendered) and an MCP server for coding agents.

## Use cases
- extract critical css from html
- inline above-the-fold css to improve first paint
- remove render-blocking stylesheets
- improve largest contentful paint score
- optimize css for static site builds
- defer non-critical css loading
- generate critical css in ci pipeline

## When to choose
- you need faster first paint and better LCP on static sites, MPAs, or SPAs
- you want deterministic output safe for CI and version control diffs
- you need a tool that works under strict Content Security Policy without inline scripts
- you want both a CLI for build pipelines and an API for programmatic use

## When to avoid
- your pages have no external stylesheets or already inline all CSS
- you need full CSS optimization like minification or purging unused styles across the whole page
- you cannot run Node.js in your build environment

## Facets
- artifact type: cli-tool
- maturity: active
- function: css-framework, build-tool, cli, developer-tools
- domain: web-development, frontend, performance, web-design
- platform: cli
- tags: critical-css, above-the-fold, render-blocking, web-performance, lcp-optimization, css-inlining, mcp-server, nodejs, web-server

## Member repositories
- addyosmani/critical (main) score 81

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:41.378637+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:19:22.822706+00:00, confidence not recorded.
  - readme: https://github.com/addyosmani/critical (fetched 2026-08-28T04:10:41.378637+00:00, sha b74f073f1345)
- Data as of 2026-08-30T08:39:29.467469+00:00.
