Magento 2 Experts — Hyvä Theme, Tailwind CSS & SEO from a Single Source ›

Magento 2 Critical CSS per Page Type, Inlined in the Head

Magento 2 Extension Hyvä Ready Magento 2.4.x

SKU: CRITICALCSSPERTYPE1

  • own critical CSS per page type and store view
  • inline in the head, remaining stylesheet non-blocking
  • fallback and size limit, no page type without styling
  • version check after theme build, test mode for admins
Auf Lager
€129.00

Einmaliger Kauf · inkl. 12 Monate Updates · zzgl. MwSt.

No download, but personal setup

No download, but personal setup. This product is not a downloadable software package for self-installation. With your order, you commission Mironsoft to individually set up this module in your shop. We will get in touch with you within 2 business days — we'll sort out the details and payment together then.

This offer is aimed at business owners and companies running a Magento 2 shop.

6 features

Magento 2 Critical CSS: visible styles first, the rest afterwards

With Magento 2 Critical CSS from Mironsoft your shop delivers, per page type, only the rules needed for the first visible area inline in the head. The full stylesheet then loads without blocking the render. Home page, category, product page, CMS page and cart each get their own critical CSS, because a product page needs different rules than a category. If a page type has no entry, a fallback applies, and the module watches a size limit. Magento 2 Critical CSS is a focused lever for First Contentful Paint and Largest Contentful Paint.

Per page type

Dedicated critical CSS for home, category, product, CMS, cart and checkout, detected through the layout handle.

Inline in the head

The critical CSS is written directly into the head without an extra request and works with the CSP mechanism.

Rest without blocking

The full stylesheet is loaded afterwards without delaying the first render.

Fallback

If a page type has no CSS of its own, the module uses a default template or serves the stylesheet as usual.

Size limit

An adjustable limit in kilobytes keeps inline CSS from bloating the HTML. Entries that are too large are reported.

Automatically refreshed

After a theme build or stylesheet update a version check marks outdated entries.

Why critical CSS

Why Magento 2 Critical CSS matters for load time and Core Web Vitals

A stylesheet in the head blocks rendering until it is loaded and processed. Even with good servers the visitor then waits on an empty screen. Anyone searching for Magento 2 render blocking CSS or Magento 2 Critical CSS wants to change exactly that: the visible part appears first, the rest follows. The default setup has no such split.

The choice per page type is decisive. A single critical CSS for all pages is either too large or too small. Magento 2 Critical CSS per page type stays small and hits the elements that are actually visible, such as header, navigation, hero area or product image.

01Page types

Assign Magento 2 Critical CSS per page type

In the admin you create an entry for each page type. The type is detected through the layout handle, for example for home, category, product or custom CMS pages. A separate set per store view is possible if your stores are built differently. Entries can be copied, enabled and disabled. A type without an entry falls back to the default rule.

  • Assignment through the layout handle
  • Separate set per store view possible
  • Copy, enable and disable entries
Content › Critical CSS › Page types
Page type
Category (catalog_category_view)
Store view
English (example)
Status
active · 9.4 KB (example value)
Critical CSS › Edit entry
Sample URL
/womens-fashion.html (example)
Rules
header, navigation, hero
Preview
layout stable
02Generate and maintain

Generate critical CSS, check it and refine it by hand

For each page type you generate the critical CSS from a sample URL. An admin button or a CLI command analyses the page and suggests the required rules. The result can be reviewed and extended in the editor, for example with rules for a cookie banner. A preview shows the page with only the critical CSS, so you notice layout jumps immediately.

  • Suggestion from a sample URL
  • Editor for corrections and additions
  • Preview with critical CSS only
03Deferred loading and fallback

Load the remaining CSS without blocking

The full stylesheet is included with a non-blocking loading method. A tiny inline snippet registered through the Hyvä CSP mechanism activates it after loading. Visitors without JavaScript get the stylesheet through a noscript entry. For page types without critical CSS a fallback delivers the stylesheet unchanged, so no page ever appears unstyled.

  • Non-blocking loading of the stylesheet
  • noscript entry for visitors without JavaScript
  • Fallback to normal delivery without an entry
Configuration › Mironsoft › Critical CSS
Deferred loading
non-blocking
noscript
active
Fallback
load stylesheet normally
Critical CSS › Overview
Last generated
2 days ago (example)
Version
matches the stylesheet
Test mode
admin only
04Control

Keep size, version and freshness in view

An overview shows size, date of the last generation and the stylesheet version that each entry matches. After a theme build or deployment the module marks entries as outdated so they get regenerated. The size limit warns when an entry holds too much inline CSS. In test mode only signed-in admin users see the result, while visitors still get the previous delivery.

  • Size and version per entry
  • Outdated flag after deployment
  • Test mode for signed-in admins only
Use cases

Where Magento 2 Critical CSS helps in daily work

Typical starting points for faster pages.

Weak mobile scores

The shop loads noticeably late on smartphones. Magento 2 Critical CSS puts the visible area on the screen first.

Campaign landing pages

For ad destination pages the page type gets a small, clean Magento 2 Critical CSS, because every second counts there.

Large categories

Category pages with many elements receive only the rules for the first screen, not for the whole product grid.

Several store views

Language versions with a different layout use their own set of entries.

Comparison

Magento 2 Critical CSS: without and with the module

What changes in delivery.

TopicWithout moduleWith Mironsoft Critical CSS
Stylesheet in the headBlocks the first renderLoaded without blocking
Choice of rulesOne stylesheet for all pagesOwn critical CSS per page type
MaintenanceManual and error proneGenerate, check, outdated flag
SafetyMissing rules show up for the visitorFallback and preview before activating
SizeUncontrolledAdjustable limit in kilobytes
Setup

How we set up Magento 2 Critical CSS for you

The process after you order.

1

Consultation

We decide which page types and store views get critical CSS and how large entries may be at most.

2

Installation

We install the module, set up Magento 2 Critical CSS for your Hyvä theme and register the inline part in a CSP compliant way.

3

Generation

For each page type we generate the entry from a sample URL and refine it.

4

Test

We check Magento 2 Critical CSS in the preview, in the mobile view and in delivery without JavaScript.

5

Handover

Your team gets an introduction to the overview, version check and regeneration after updates.

Differences

Difference to lazy loading, CSS minification and cache warming

The Mironsoft module for lazy loading images defers images, not stylesheets. Magento 2 Critical CSS deals exclusively with the stylesheet in the head. Minifying and bundling files is still done by Magento or your build, and warming the cache is a separate topic. The modules complement each other and can be combined.

All modules can be combined. The module works with the Hyvä theme and the Tailwind stylesheet and needs no additional library.

05How the purchase works

No download, personal setup instead

Critical CSS is not listed here as a ready-made download file for self-installation. The purchase is a service commission: we get in touch after the purchase, install the module in your shop and agree on page types, size limit and fallback together with you.

Important to know

Your purchase does not include a download link. We will get in touch with you within 2 business days — we'll sort out the details and payment together then. This offer is aimed at business owners and companies running a Magento 2 shop.

FAQ

Frequently asked questions

Everything about page types, fallback, freshness and how the purchase works.

How do I set up Magento 2 Critical CSS?
In the admin you create an entry per page type, generate the critical CSS from a sample URL, check the preview and activate the entry.
Why separate critical CSS per page type?
Because home page, category and product page show different elements on the first screen. One shared CSS would be too large or miss rules.
What happens if a page type has no entry?
The fallback applies: a default template is used or the stylesheet is delivered as usual. No page appears unstyled.
How does the critical CSS stay up to date?
A version check marks entries as outdated after a theme build. You regenerate them one by one or in bulk.
Does it interfere with caching?
No. The critical CSS is part of the page content and is delivered with the full page cache. After a change you flush the affected cache as usual.
Does Magento 2 Critical CSS work with Hyvä and CSP?
Yes. The inline part is registered through the Hyvä CSP mechanism and no library is added.
How large may the critical CSS be?
You define that with the size limit. Entries that are too large are reported so the HTML stays lean.
Does the module guarantee better scores?
It improves how the stylesheet is delivered. The result depends on theme, server and content; we recommend measuring before and after.
How is this different from lazy loading?
Lazy loading concerns images, Magento 2 Critical CSS concerns the stylesheet in the head. Both measures can be combined.
Can I download and install the module myself?
No. This offer is not a download product. After the purchase we install and configure the module personally in your shop.
Write Your Own Review
You're reviewing: Magento 2 Critical CSS – Mironsoft
loader
Loading...

You submitted your review for moderation.

This form is protected by reCAPTCHA - the Google Privacy Policy and Terms of Service apply.

Magento 2 Critical CSS – Mironsoft

Magento 2 Critical CSS – Mironsoft

€129.00