Skip to main content
GrN.dk

Main navigation

  • Articles
  • Cases
  • Contact
  • Your Digital Project Manager
  • About Greg Nowak
  • Services
  • Portfolio
  • Container
    • Excel Freelancer
    • Kubuntu - tips and tricks
    • Linux Apache MySQL and PHP
    • News
    • Image Gallery
User account menu
  • Log in

Breadcrumb

  1. Home

Critical CSS for Faster Pages: When It Helps and When It Does Not

By Greg Nowak. Last updated 2026-07-06.

Critical CSS is the small slice of styling a browser needs to render the first visible part of a page. If a large stylesheet sits in the <head>, the browser may need to download and process it before it can paint useful content. Inlining the right CSS can make a page feel alive sooner.

That does not make critical CSS a universal fix. For a business site, the useful question is not whether Google likes faster pages. The useful question is whether render-blocking CSS is actually delaying the pages that matter: service pages, campaign landing pages, quote forms, ecommerce category pages, or high-traffic editorial templates.

Start With the Bottleneck

Critical CSS should come after measurement, not before it. Use Lighthouse, PageSpeed Insights, WebPageTest, or Chrome DevTools to see what is really slowing the first useful render. If the main delay is server response time, an oversized hero image, web font loading, third-party scripts, or JavaScript hydration, inlining CSS may add complexity without moving the business metric.

It is most promising when important templates share a large stylesheet, Lighthouse flags render-blocking CSS, and the largest visible content is waiting on layout and styling rather than image transfer. It is less promising when your CSS is already small, your pages are highly unique, or your CMS allows editors to assemble unpredictable first screens.

Decision Evidence to Look For Practical Action
Use it Render-blocking CSS delays first render or LCP on valuable templates. Generate critical CSS per template in the build or release process.
Pilot it Large shared CSS bundle, but mixed causes in the waterfall. Test one or two lead-generating templates before rolling it across the site.
Skip it for now Slow TTFB, heavy images, JavaScript, or unstable layout are the bigger problems. Fix those bottlenecks first, then retest CSS delivery.
A simple decision matrix for deciding whether critical CSS belongs in the next performance sprint.

What Belongs in the Critical Layer

Keep the critical layer boring and small. It should cover the base layout, typography needed for the first screen, header, navigation, hero area, visible buttons, and any above-the-fold form fields. It should also preserve reserved space for visible media so the first render is not followed by a layout jump.

Leave out below-the-fold components, footers, admin styles, editor-only UI, rarely used utility classes, animations, and page-builder widgets that do not appear immediately. Be careful with font rules and background images. Sometimes they belong in the first render; often they are better loaded normally or intentionally ignored during extraction.

Make It a Repeatable Build Step

Manual critical CSS ages badly. Online generators are fine for proving the idea, but production work should run from the same templates, routes, and assets your site actually deploys. Generate by page family, not by random individual URLs, and test both mobile and desktop viewports because breakpoint-specific layout rules are easy to miss.

For Node-based builds, the critical package remains a practical starting point:

pnpm add -D critical
import { generate } from 'critical';

await generate({
  base: 'dist/',
  src: 'index.html',
  inline: true,
  target: {
    html: 'index-critical.html',
    css: 'critical.css'
  },
  dimensions: [
    { width: 390, height: 844 },
    { width: 1280, height: 900 }
  ]
});

Watch the maintenance details: asset paths, CDN URLs, web fonts, cookie banners, logged-in CMS states, and editor-controlled blocks. Also be cautious with extraction options that create page-specific non-critical CSS files. A template can look faster in a one-page test while losing cache efficiency across the wider site.

Pair It With CSS Cleanup

If the global stylesheet has years of legacy selectors, critical CSS is only part of the answer. Remove unused CSS carefully, then keep the critical layer small. PurgeCSS can help, but CMS and JavaScript classes must be safelisted or you will remove styles that only appear at runtime.

await new PurgeCSS().purge({
  content: ['templates/**/*.html', 'src/**/*.js'],
  css: ['dist/app.css'],
  safelist: [/^is-/, /^has-/, /^js-/],
  rejected: true
});

Review the rejected list during rollout. That quick check often catches over-pruning before a campaign page, menu state, or form validation message breaks in production.

Drupal Notes

For Drupal sites, the critical_css module is still available. As of July 2026, Drupal.org lists the module as feature-complete with maintenance fixes only, and the stable 2.0.x release supports Drupal 9, 10, and 11:

composer require 'drupal/critical_css:^2.0'

The important detail is that the module does not remove the need to generate critical CSS. It loads the critical file you provide and can load other head CSS asynchronously. Treat it as a Drupal delivery mechanism, while your build or release process remains responsible for producing accurate CSS for each template.

Measure the Business Impact

Critical CSS can support SEO, but it is not a ranking shortcut. Google’s current Core Web Vitals are LCP, INP, and CLS. Critical CSS mainly helps the loading and rendering side of that picture; it will not fix poor interaction latency or layout instability unless those problems are connected to CSS delivery.

Measure before and after on anonymous mobile pages. Look at render-blocking resources, LCP element timing, visual stability, and whether forms or calls to action become usable sooner. Then monitor Search Console field data after enough real users have visited. The win is not a perfect synthetic score. The win is a page that feels credible faster and gives prospects less time to leave.

If you need a practical read on whether critical CSS is worth the effort, Greg can help you scope the right performance fix across CSS delivery, Drupal theming, front-end build workflow, and conversion-critical templates.

Related on GrN.dk

  • Why Your Website's Third-Party Stack Needs a Real Owner
  • Optimizing Drupal: A Practical Speed Checklist
  • WordPress Google PageSpeed: Practical Fixes for Core Web Vitals

Need help with this kind of work?

Get help scoping the right performance fix Get in touch with Greg.

Sources

  • Understand the critical path | web.dev
  • Understanding Core Web Vitals and Google search results | Google Search Central
  • addyosmani/critical | GitHub
  • Configuration | PurgeCSS
  • Critical CSS | Drupal.org
Last modified
2026-07-06

Tags

  • seo
  • Performance
  • css
  • Drupal
  • Core Web Vitals

Review Greg on Google

Greg Nowak Google Reviews

 

Illustrated infographic summarizing: Shorter TLS certificates expose every renewal you never automated
Shorter TLS certificates expose every renewal you never automated
2026-07-26

Shorter TLS lifetimes leave less room for manual handoffs and faulty deploy hooks. Build a renewal path that protects service availability.

Illustrated infographic summarizing: One Timeout, Two Orders: Make AI Actions Safe to Retry
One Timeout, Two Orders: Make AI Actions Safe to Retry
2026-07-25

A timed-out AI action may already have succeeded. Stable keys, durable ledgers, queues and stored results prevent a routine retry from duplicating real work.

Illustrated infographic summarizing: Your AI Visibility Dashboard Needs a Methodology, Not More Charts
Your AI Visibility Dashboard Needs a Methodology, Not More Charts
2026-07-24

A practical framework for measuring AI-search visibility with fixed prompts, repeated tests, separate metrics, retained evidence, and honest reporting.

Illustrated infographic summarizing: AI Admin APIs Are Here—But Your Directory Is Still the Source of Truth
AI Admin APIs Are Here—But Your Directory Is Still the Source of Truth
2026-07-23

New AI admin APIs can automate access and spend controls, but reliable governance still starts with authoritative directory data and clear ownership.

Illustrated infographic summarizing: OpenAI Presence Arrived—But Is Your Workflow Ready for an Agent?
OpenAI Presence Arrived—But Is Your Workflow Ready for an Agent?
2026-07-22

Before an AI agent can take on real work, its workflow needs clear scope, permissions, handoffs, evaluation cases, and production monitoring.

Illustrated infographic summarizing: Chatbot Transcripts Quietly Became a Retention and Redaction Problem
Chatbot Transcripts Quietly Became a Retention and Redaction Problem
2026-07-21

Chatbot transcripts spread across providers, logs and support tools. Here is how to map each copy, redact sensitive data and test deletion properly.

Illustrated infographic summarizing: Cloudflare Service Keys Stop in September: Find Every Caller
Cloudflare Service Keys Stop in September: Find Every Caller
2026-07-20

Cloudflare Service Keys stop working on September 30, 2026. Here is how to find every caller, move to scoped API tokens and avoid a late outage.

Illustrated infographic summarizing: Your AI Workflow Needs an Acceptance Test Before It Meets Customers
Your AI Workflow Needs an Acceptance Test Before It Meets Customers
2026-07-19

A practical way to test AI workflows using realistic scenarios, tool checks, human rubrics, regression suites, and clear release gates.

Three cover candidates for The Goats Were Load-Bearing fanned on a dark background: an ember-lit door, three slow knocks, and a founders' ledger
The Goats Were Load-Bearing: a fantasy where the bill always comes due
2026-07-19

A teaser for the upcoming darkly comic fantasy novel The Goats Were Load-Bearing — a village, a door that must stay poor, and the worst possible time to sell the herd. Readers pick the cover.

Vegan Power game: the yellow player catches falling fruit while a chicken and a cow look on
Vegan Power: The Little Game About Eating Fruit, Not Friends
2026-07-19

Vegan Power is a free browser game where you catch fruit, dodge the animals, protect seven hearts, and chase a better high score.

More articles
RSS feed

GrN.dk web platforms, web optimization, data analysis, data handling and logistics.