Eliminate Render-Blocking CSS, Forever.
Hyvä Inline CSS
for Magento 2

Hyvä Inline CSS Extension for Magento 2
Hot
Hyvä Compatible Themes Out-of-the-box
Mage-OS Compatible
Composer Installation Composer Installation?
shapes Free Power Toy Available

Automatically Generate And Inline Only The CSS Each Page Needs,
So Your Hyvä Storefront Paints Instantly

Eliminate render-blocking resources, slashing FCP/LCP times, and perfecting your Core Web Vitals.

Cross the final frontier of performance optimization. This is the definitive solution for Hyvä Themes to automatically remove unused CSS and go completely CSS-less, delivering the fastest possible experience for your users from the very first byte.

  • Go Truly CSS-less:
    Automatically generate and inline only used CSS for each page, eliminating the need for external stylesheets.
  • Instant First Paint:
    Eradicate render-blocking CSS to dramatically improve First Contentful Paint (FCP) and Largest Contentful Paint (LCP).
  • 100% Risk-Free:
    Full Compatibility Mode ensures your design remains perfect while still delivering massive performance gains.
  • Intelligent & Automated:
    Handles custom/third-party CSS, dynamic content via a Safe List, and features a dedicated cache for zero server overhead on repeat views.

See All Highlights

License:


Magento Marketplace Approved by
  • One-Time Payment
  • Lifetime Access To Source Code
  • 1 Year Free Support
  • 1 Year Free Updates
awesomeicons6/brands/magento

Approved & Verified by Magento Marketplace

awesomeicons6/solid/award

1st Extension Provider
     With Hyvä Support
     Awesome since 2021!

awesomeicons6/solid/code-fork

Unencrypted. 100% Open Source & Customizable

awesomeicons6/solid/code

Coding Standards Applied. Clean & Readable Code

awesomeicons6/regular/face-smile-beam

Countless Satisfied Customers: Be The Next One!

awesomeicons6/regular/heart

Made With Love

Our extensions are made with love & passion for building new things, perfection & performance in mind.

awesomeicons6/solid/handshake

Field Tested

Our extensions are field-proven in our own client projects.

Customer Feedback

The Challenge & The Solution:

Run Your Hyvä Themes Magento Store Without CSS File With Hyvä Inline CSS by JaJuMa!

Say Good-Bye To Your CSS Files & Unused CSS
Speed Up Page Rendering By Removing Blocking Styles
Improve FCP & LCP Performance KPIs

The Challenge:
Why Your "Perfect" Hyvä Score is Still Held Back

You've invested in Hyvä for its legendary performance, yet that perfect 100/100 PageSpeed score remains elusive.

The culprit is a hidden speed killer that affects every site, no matter how optimized:

Understand the...

Render-Blocking CSS file:

Even with Hyvä's brilliant use of TailwindCSS, your store generates a single, global styles.css file. When a user visits any page, their browser must download this entire file before it can render a single pixel.

This delay is the definition of "render-blocking".
On mobile networks, the network latency (Round Trip Time or RTT) to even begin fetching this file can add 200-400ms of dead time before the rendering starts.

This single request is the primary bottleneck for your First Contentful Paint (FCP) and overall user perception of speed.
Furthermore, this global file contains styles for every component on your entire site, meaning most of the CSS downloaded for any given page is completely unused, bloating the initial payload and wasting bandwidth.

The Solution:
Go CSS-less.
Render Instantly.

Our Hyvä Inline CSS extension eradicates this bottleneck entirely.
It transforms your site's architecture by automatically generating a perfectly optimized set of styles for every single page and embedding this CSS directly into the HTML.

Here is how it works...

No render-blocking CSS - Instant First Paint:

The Result:
no external CSS file, no render-blocking network request, and an instantaneous first paint.

  • On-the-Fly Generation:
    The extension analyzes each page request in real-time, collects every CSS class used in the HTML, and purges everything that's unnecessary using the powerful purgecss library.
  • Inline Injection:
    This hyper-lean, minimal CSS is then injected directly into the <head> of the HTML document. The browser receives everything it needs to render the page perfectly in the very first response, without making a single extra network request for styles.
  • Beyond Critical CSS:
    This is not the old, flawed "critical CSS" method.
    Traditional critical CSS struggles to identify the correct styles for all devices (the "fold problem") and often causes a jarring Flash of Unstyled Content (FOUC). By inlining all used styles for the entire page, we eliminate these problems completely, ensuring a perfect, stable render from top to bottom on the first visit.

Highlights

Hyvä Inline CSS for Hyvä Themes & Magento 2 by JaJuMa-Develop Inline CSS =
Faster Page Rendering

Run Your Hyvä Themes Magento Store Without Render-Blocking CSS File
Avoid Unused CSS

awesomeicons6/solid/wand-magic-sparkles

Auto Generate & Inline CSS

Go truly CSS-less. Automatically generate and inline only the CSS used on each individual page.

awesomeicons6/solid/broom

Auto Remove/Cleanup Unused CSS

Stop shipping dead code. Our process automatically purges all unused styles for the leanest possible payload on every request.

awesomeicons6/solid/bolt-lightning

Remove Render-Blocking CSS

Achieve near-instant FCP and LCP by removing the external CSS file request, the #1 cause of render-blocking.

awesomeicons6/solid/puzzle-piece

Supports Including 3rd Party CSS

Your entire frontend, unified. The extension can find, process, and inline styles from other third-party modules.

awesomeicons6/solid/list-check

Safe List Config for Missing/Dynamic Classes

Maintain perfect styling for dynamic content. Easily configure the extension to never remove CSS classes added by JavaScript.

awesomeicons6/solid/file-import

Include Files With Dynamic CSS

Go beyond the Safe List. Point the extension to specific PHTML or JS files to ensure 100% accurate CSS generation for complex components.

awesomeicons6/solid/handshake-simple

Compatibility Mode = 100% Compatibility

Get the speed benefits with zero risk. Our unique compatibility mode guarantees perfect styling while still deferring the main stylesheet.

awesomeicons6/solid/a-1

Inline CSS Optionally Only On 1st Pageload

Maximize first-visit speed and leverage browser caching for repeat visits with this intelligent, automated optimization strategy.

awesomeicons6/solid/bug

Debug Tool To Easily Verify

Get instant insights into the extension's behavior directly on the frontend, showing cache status, processing times, and gzipped size.

awesomeicons6/solid/gauge-high

Free Power Toy Add-On

Supercharge your workflow with our free Power Toy, providing a persistent dashboard to monitor inline CSS status without enabling debug mode.

awesomeicons6/brands/hyva-colored

Hyvä Theme Compatible

Built from the ground up for Hyvä Themes. No compatibility module required.

awesomeicons6/brands/mage-os-filled

Mage-OS Compatible

Fully compatible and tested with Mage-OS, ensuring your store is future-proof.

Details & How It Works Inline CSS For Hyvä Themes & Magento 2
by JaJuMa

The Hyvä Inline CSS Extension fundamentally changes how styles are delivered to the browser. Instead of waiting on external CSS files, it injects critical styles directly into the HTML response, eliminating render-blocking and network latency. The following comparison highlights how this approach impacts key performance metrics.

Table: Hyvä Inline CSS Extension - Performance Impact
Metric Standard Hyvä (External CSS) With Hyvä Inline CSS Extension Performance Impact
Render-Blocking Resources 1 (styles.css) 0 ✅ Eliminated
Network RTT for Styles ~200–400ms (Mobile) 0ms ✅ Eliminated
First Contentful Paint (FCP) Delayed by CSS Download Near-Instant 🚀 Drastically Accelerated
Largest Contentful Paint (LCP) Delayed by CSS Download Near-Instant 🚀 Drastically Accelerated For Text LCPs
Unused CSS per Page Present Removed 📉 Smaller Payload
Subsequent Navigation Memory Cache Hit
(~0ms)
Disk Cache Hit
(Disk lookup + parse ~5–15ms)
Inline CSS
(20Kb ~16ms download + 0–2ms inline overhead)
⚖️ Penalty ~10–20ms / Draw
🏆 Key Takeaway

In summary, the Hyvä Inline CSS Extension removes critical bottlenecks by eliminating render-blocking resources and costly RTT delays.
The result is faster FCP, LCP, and overall page responsiveness.
For mobile users on slower connections, this can mean hundreds of milliseconds saved per request.

The Final Frontier of CSS Optimization: How It Works

Gain unparalleled control and automation over your store's CSS delivery. Our extension provides a robust, flexible toolkit to handle any scenario, from complex dynamic content to third-party extensions, ensuring maximum performance without compromise.

01

Automated On-the-Fly
Generation Engine

Never ship render-blocking and a single byte of unused CSS again.
Our engine analyzes the DOM of every page request, collects all used CSS classes, and generates a perfectly optimized, minimal stylesheet in real-time.

  • 1
    Collect All CSS Classes Used

    When a page is requested, the extension intercepts the response before it's sent to the browser. It scans the entire HTML document, collecting every single CSS class that is actually used.

  • 2
    Generate Optimized, Page-Specific CSS

    A unique hash value is created for the cleaned list of classes. If this hash already exists in our dedicated long-lived cache, the optimized CSS is served instantly. If not, this list of used CSS classes is then processed on the server by purgecss, a highly efficient tool that removes all unused styles from your main stylesheet to generate a new, hyper-optimized CSS for this specific page / set of CSS classes that is then saved to the cache with its hash value.

  • 3
    Inline CSS & Deliver Instant Paint

    This block of CSS that is perfectly tailored to that specific page then gets added directly into a <style> block in the HTML <head> before the page is delivered to the browser. This process also intelligently identifies and includes styles from other compatible third-party modules, ensuring a unified and optimized frontend without manual intervention.

02

Precision Control for Dynamic Content
(Safe List & File Inclusion)

Flawlessly style even content dynamically loaded by JavaScript.
Easily add dynamic CSS classes (e.g., from Alpine.js components or sliders) to a "Safe List" or include entire JS/PHTML files in the scan to ensure they are never purged.

Modern storefronts rely heavily on JavaScript to create dynamic experiences, such as image sliders, pop-ups, or content loaded via AJAX. These elements, and their associated CSS classes, are often not present in the initial HTML source code that our extension scans.
To solve this, we provide two powerful options for developers:

  • Manual Safe List:
    A simple text field in the configuration where you can list any CSS classes you want to protect from being removed.
    This is perfect for classes added by Alpine.js or other scripts.
    As an example of our deep experience, the extension comes pre-configured with the necessary safe-listed classes for the popular glider.js slider.
  • Additional Files for Purge CSS:
    For more complex components, you can instruct the extension to scan specific .phtml templates or even .js files.
    This ensures that any classes within those files are considered "used" and are included in the final inlined CSS.
03

Guaranteed Stability:
The 100% Compatibility Mode Advantage

Get the speed benefits with zero risk.

Enable Compatibility Mode to inline the used CSS for an instant paint, while also loading the full stylesheet asynchronously in the background as a fallback.

We understand that launching a new performance optimization can feel risky on a complex, live storefront.
That's why we built Compatibility Mode as the ultimate safety net.

When enabled, the extension still performs its full optimization process - generating and inlining the used CSS for an instant first paint. However, it also adds the original, full styles.css file back to the page, but in a non-render-blocking way.
You can configure it to load with low priority or, for maximum performance, only after the first user interaction (like a scroll or click).

This gives you speed and peace of mind:
The immediate rendering benefit of inline CSS and the 100% guarantee that every single style will be available, just as the designer intended.

04

The Best of Both Worlds:
"First Page Load Only"
Optimization

Maximize first-visit speed and leverage browser caching for repeat visits.
This smart option inlines CSS only for the first page a user visits.
For all subsequent pages, it uses the standard external stylesheet, which is now already in the browser's cache.

This is an advanced strategy for merchants who want to balance the ultimate first-impression speed with the long-term benefits of browser caching.

When this mode is active, the extension checks if the user's browser has already cached the main styles.css file. If not (i.e., it's their first visit), it inlines the CSS for maximum speed.
If the file is already cached, the extension does nothing, allowing the browser to use the fast, local copy. This provides an unparalleled experience for new visitors while reducing HTML size for returning customers.

awesomeicons6/solid/triangle-exclamation
INSIGHT:
This approach requires Magento to generate and store separate Full Page Cache versions for pages with and without inline CSS. This may increase the time it takes to fully "warm" your cache after clearing it, a trade-off for this highly targeted optimization.

The Prove From Theory to Reality:
The Impact on FCP & LCP

In Action: Visualizing the Performance Gain

Don't just take our word for it. See the dramatic, measurable improvement in your Core Web Vitals.
By eliminating the CSS download from the critical rendering path, your pages begin painting content the moment the HTML arrives, delighting users and search engines.

The waterfall charts below illustrate the difference.
The Browser begins rendering instantly, dramatically improving both First Contentful Paint (FCP) and Largest Contentful Paint (LCP).
This simple change can easily shave over 200ms off your mobile load times - a massive win for conversion and SEO.

First Contentful Paint (FCP): Before vs. After

Hyvä Inline CSS vs. Hyvä Theme CSS File Comparison First Contentful Paint (FCP)
Before: With Render-Blocking CSS

The browser must wait for the `styles.css` file to download completely before rendering can begin (Notice the purple bar in the waterfall image representing the `styles.css` file.). This is the render-blocking delay in action, caused by an extra network request (RTT bottleneck).

In the default case, the FCP event occurs only after the CSS file has been downloaded, as it is render-blocking.

After: With Inline CSS

The `styles.css` request is gone.
As a result, the FCP event happens almost immediately as the necessary styles are included in the initial HTML document.

In the case of inline CSS, the FCP event occurs even before the HTML was fully downloaded, as inline CSS is not render-blocking.

Largest Contentful Paint (LCP): The Compounding Effect

The benefit extends directly to your Largest Contentful Paint (LCP).
By eliminating the initial CSS download delay, the browser can discover and start downloading your LCP image or rendering your LCP text block hundreds of milliseconds sooner.

Before: LCP is Delayed

When the LCP element is a text block, it suffers the same render-blocking fate as the FCP. It cannot be displayed until the CSS file is fully downloaded.

In case of loading the CSS as a file, the LCP event still occurs only after the CSS file has been downloaded.

After: LCP is Accelerated

By inlining the CSS, the critical rendering path is accelerated, allowing the LCP text block to be painted as soon as the HTML arrives.

But in case of inline CSS, the LCP event now occurs even before the HTML document was fully downloaded as well.

Hyvä Inline CSS vs. Hyvä Theme CSS File Comparison Largest Contentful Paint (LCP)

Pro Tip: Maximize Your Gains

Page loads in the examples above were recorded with slow 3G network throttling using Chrome browser.
How much you can improve your performance KPIs using this extension largely depends on client network speed as well as the size of your LCP element.

For maximum benefits, it is recommended to also optimize loading of LCP elements by e.g. using next-generation images (WebP & AVIF) with our Ultimate Image Optimizer and making sure the LCP image is loaded with highest priority, e.g. by using our Preload Critical Resources & Assets extension.

The JaJuMa Difference: Expertise Forged in the Hyväverse
Built by a Hyvä Gold Partner & Core Contributor

Invest in a solution built by recognized leaders.
As a Hyvä Gold Partner and one of the earliest pioneers in the ecosystem,
we don't just use Hyvä - we help build and define it.
This extension is the product of four years of deep, hands-on experience optimizing the most demanding Hyvä stores.

Hyvä Gold Partner

Hyvä Gold Partner

We hold one of the highest distinctions for expertise and contribution in the Hyvä ecosystem, earned through proven project success and deep collaboration.

JaJuMa Hyva Technology Partner official badge

Pioneering Experience

We were the first extension provider to offer official Hyvä compatibility, leading the way for the entire marketplace from day one.

JaJuMa Hyva Contributor official badge

Core Contributors

Our team actively contributes to the Hyvä core codebase. We have a fundamental understanding of how Hyvä works because we help make it work.

Merchant & Developer-Centric Tools

We support our extensions with free tools like the Hyvä Inline CSS Power Toy and the included Debug Tool, giving mechants and developers the visibility they need to optimize with confidence and efficiency.

Proven
in the Field

All our extensions are battle-tested in our own demanding real-world client projects before they are ever released.
This ensures they are robust, reliable, and deliver real-world results that we stand behind.

Customer Reviews

Rating
Everything works perfectly
Review by
The module correctly includes all Tailwind styles in the inline CSS, including arbitrary and responsive classes.

Really appreciate your support and this great module!
Rating
Fully automatic!
Review by
Well thought out. I am very satisfied and will definitely recommend you!

Write Your Review

Your Rating:
Loading...

You submitted your review for moderation.

Frequently Asked Questions

Hyvä Inline CSS Questions
Is this extension only for Hyvä Themes?

Yes. It is specifically designed and engineered to leverage the modern architecture of Hyvä and its use of TailwindCSS. It does not support Luma or other traditional Magento themes.

What are the technical requirements for installation?

You need a working Hyvä Theme installation on Magento 2.4.x or higher. On your server, you must have Node.js and npm installed. The only required step after installation is to run the npm install purgecss command in your theme's web/tailwind directory.

Will this break my site if I have dynamically loaded content from JavaScript?

No. We've built in two powerful solutions to handle this: the "Safe List" allows you to specify any CSS classes that are added by JavaScript (like from Alpine.js), ensuring they are never removed. For more complex cases, you can even specify entire JS or PHTML files for the extension to scan. For ultimate peace of mind, you can enable "Compatibility Mode".

How does the caching work? Will this slow down my server?

The extension has its own dedicated cache for the generated CSS. Once the unique CSS for a page type is generated, it's stored. Subsequent requests for the same page serve the CSS directly from this cache, imposing virtually no server overhead. The cache lifetime is configurable (default is one year) and is independent of the main Magento cache, giving you granular control.

What is the difference between this and Magento's native "Critical CSS" feature?

Magento's native feature is a legacy tool designed for the Luma theme. It relies on the outdated "critical CSS" methodology, which is difficult to maintain and often causes a "Flash of Unstyled Content" (FOUC). Our extension uses a modern, superior approach by inlining all used CSS for the entire page, which completely eliminates FOUC and the "fold problem." It is fully automated and specifically built for the lean, efficient architecture of Hyvä.

What happens if I install a new third-party module with its own stylesheet?

Our extension is built to solve this exact problem. By enabling the "Collect All CSS Files" option, the extension will automatically detect the new stylesheet from the third-party module, merge it with your theme's primary stylesheet during the generation process, and inline all the necessary styles in a single block. This tames third-party CSS bloat and keeps your frontend lean.

What is included with my purchase?

Your purchase includes a license for one Magento installation, lifetime access to the 100% open-source code, one year of free, expert support via our ticket system, and one year of free updates.

Is the code open source?

Yes, 100%. All of our extensions are provided unencrypted, allowing you or your development team full access to customize or audit the code as needed, in line with our commitment to the open-source spirit of Magento and Hyvä.

Changelog

Version: 1.0.0

  • Initial Release

Version: 1.0.1

  • Improved: Changed load order to avoid conflicts with some other inline CSS
  • Added: Example/Default config for safelist when using glider.js

Version: 1.0.2

  • Fixed: Issue with Tailwind !important prefix
  • Improvement: Hyvä Checkout support

Version: 1.0.3

  • Fixed: Conflict with JaJuMa Hyvä PWA

Version: 1.0.4

  • Updated: Compatibility with upcoming extension

Version: 1.0.5

  • Fixed: Issue with M2.4.6 + Varnish

Version: 2.0.0

  • Added: Option to include files with dynamically rendered CSS classes in inline CSS generation process
  • Added: Option to include custom/3rd party CSS files in inline CSS
  • Added: Option to exclude certain pages from using inline CSS
  • Improved: Add new inline CSS cache type for cached inline styles
  • Updated: Debug bar styles and position
  • Fixed: Minor bugs and issues

Version: 2.0.1

  • Fixed: Issue with relative path background image

Version: 2.0.2

  • Improved: Compatibility with Varnish

More Extensions

Maybe also interesting for you?
More valuable Extensions and Add-Ons for your Magento Store

Our Customers Are Excited!

Find all you need to know and more valuable insights about Hyvä and Magento.
Expertly curated by JaJuMa:

🚀 Launch the JaJuMa Hyväverse

Your central resource for everything Hyvä.

Explore the Magento Metropolis!

Your central resource for everything Magento.



How do you like this extension?