# critical > Extract the critical-path (above-the-fold) CSS from your HTML, inline it, and load the rest > asynchronously — so the browser can paint the first screen without waiting on a full stylesheet. Critical removes render-blocking CSS from the critical path, which is one of the most direct levers on **Largest Contentful Paint** and first render. It works for static sites, MPAs, and single-page apps, and it's built to be driven by humans, build pipelines, and coding agents alike. ```sh npm install --save-dev critical ``` --- ## Contents - [How it works](#how-it-works) - [Quick start](#quick-start) - [Two engines](#two-engines) - [CLI reference](#cli-reference) - [API reference](#api-reference) - [Inlining behavior](#inlining-behavior) - [Tuning the above-the-fold set](#tuning-the-above-the-fold-set) - [MCP server (agents)](#mcp-server-agents) - [Recipes](#recipes) - [Design principles](#design-principles) - [Requirements](#requirements) - [Alternatives](#alternatives) --- ## How it works Given an HTML document and its stylesheets, Critical: 1. **Determines what's critical.** It figures out which CSS rules style the content that paints above the fold — either by matching rules against the delivered DOM (fast, no browser) or by rendering the page in a real viewport (accurate, handles SPAs). See [Two engines](#two-engines). 2. **Inlines it.** The critical rules go into a `` as the first child of `` so it wins the cascade race against the deferred sheets. 2. Stops each `` from blocking the first paint, using the preload strategy: ```html ``` The preload starts the download early; the stylesheet applies after the above-the-fold content (already styled by the inlined critical CSS) has painted. There is **no inline event handler**, so this works under a strict `script-src` Content Security Policy, and **no `