# Critical CSS is inlined or render-blocking CSS is eliminated

- **Pattern:** `ab-001789` (`marketing-page-speed.resource-optimization.critical-css-inlined`)
- **Severity:** high
- **Lifecycle:** active
- **Last modified:** 2026-04-18
- **Canonical URL:** https://auditbuffet.com/patterns/ab-001789
- **License:** CC-BY-4.0 — attribute to AuditBuffet Pattern Catalog (https://auditbuffet.com/patterns/ab-001789)

## Why it matters

Every external `<link rel="stylesheet">` in `<head>` adds at minimum one additional network round-trip before the browser can render a single pixel — this is the definition of a render-blocking resource as measured by ISO-25010 time-behaviour. On a 4G connection, one round-trip is approximately 80–120ms; three blocking stylesheets add 240–360ms to FCP before any page content appears. This is distinct from CSS file weight: even a 1KB external stylesheet blocks paint if it's in `<head>` without a non-blocking loading pattern. Marketing pages accumulate these most often from third-party widget CSS (chat, cookie consent, marketing pixels) pasted in verbatim from vendor documentation.

## Severity rationale

High because each render-blocking stylesheet in `<head>` adds a full network round-trip to FCP regardless of the file's size, making this a pure latency tax with no user benefit.

## Remediation

Load non-critical CSS asynchronously using the print-media trick, or eliminate external stylesheets entirely by inlining critical CSS through your framework.

```html
<!-- Before — blocks all rendering -->
<link rel="stylesheet" href="/styles/widget.css" />

<!-- After — loads non-blocking, applies when done -->
<link rel="stylesheet" href="/styles/widget.css"
      media="print" onload="this.media='all'" />
<noscript><link rel="stylesheet" href="/styles/widget.css" /></noscript>
```

For Next.js projects: import CSS in component files rather than via `<link>` tags — Next.js inlines critical CSS into `<style>` blocks in the HTML automatically, eliminating the extra round-trip. Verify this is working by checking the `<head>` in `next build` output for inline `<style>` blocks rather than `<link>` tags.

## Detection

- **ID:** `critical-css-inlined`
- **Severity:** `high`
- **What to look for:** Check the `<head>` section of marketing pages for external `<link rel="stylesheet">` tags that block rendering. Every external CSS file in `<head>` delays FCP by one network round-trip. Examine: (1) how many CSS files are loaded via `<link>` in `<head>`, (2) whether Tailwind's output is inlined or a separate file, (3) whether any CMS or third-party CSS (e.g., Google Fonts CSS) is loaded render-blocking. For Next.js, CSS is typically inlined in `<style>` tags in the HTML — verify this in the build output. Count all instances found and enumerate each.
- **Pass criteria:** No render-blocking external stylesheets in `<head>`. CSS is either inlined in `<style>` tags, loaded with `media="print" onload="this.media='all'"` pattern, or the framework handles CSS injection automatically (Next.js inlines CSS by default). At least 1 implementation must be confirmed.
- **Fail criteria:** Multiple external `<link rel="stylesheet">` tags in `<head>` that block rendering. Each one adds a network round-trip before the browser can paint.
- **Skip (N/A) when:** Framework handles CSS inlining automatically and build output confirms inline `<style>` blocks (Next.js with CSS Modules, Tailwind).
- **Detail on fail:** `"3 external stylesheets in <head>: reset.css, fonts.css, and a third-party widget stylesheet. Each blocks FCP by one RTT (~100ms on 4G)."`
- **Remediation:** Eliminate render-blocking CSS:

  ```html
  <!-- Before — blocks rendering -->
  <link rel="stylesheet" href="/styles/fonts.css" />

  <!-- After — non-blocking load -->
  <link rel="stylesheet" href="/styles/fonts.css"
        media="print" onload="this.media='all'" />
  <noscript><link rel="stylesheet" href="/styles/fonts.css" /></noscript>
  ```

  Or better — use Next.js built-in CSS handling, which automatically inlines critical CSS and defers the rest.

## External references

- iso-25010 performance-efficiency.time-behaviour

Taxons: performance

HTML version: https://auditbuffet.com/patterns/ab-001789
