PHPackages                             gitterdoc/critical - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. gitterdoc/critical

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

gitterdoc/critical
==================

Laravel provider that will extract critical CSS.

1.0.0(7y ago)21.0k1[2 issues](https://github.com/gitterdoc/critical/issues)MITPHP

Since Jul 20Pushed 7y agoCompare

[ Source](https://github.com/gitterdoc/critical)[ Packagist](https://packagist.org/packages/gitterdoc/critical)[ Docs](https://gitterdoc.com/)[ RSS](/packages/gitterdoc-critical/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

💥 How it work's?
----------------

[](#boom-how-it-works)

This package will resolve needed styles and pack it to the header. The rest of additional styles will be appended to the body and will be loaded after the page is ready. Warranty for google Pagespeed up to 100% and compatible with `Bootstrap`!

[![google PageSpeed: Desktop](https://camo.githubusercontent.com/cd83e9f71f66c5dad78df99de4ca849b2fb567f1911f9b8f1c1144ba0720bbd9/68747470733a2f2f676974746572646f632e636f6d2f4769744875622f7061676573706565645f6465736b746f702e706e67)](https://camo.githubusercontent.com/cd83e9f71f66c5dad78df99de4ca849b2fb567f1911f9b8f1c1144ba0720bbd9/68747470733a2f2f676974746572646f632e636f6d2f4769744875622f7061676573706565645f6465736b746f702e706e67) [![google PageSpeed: Mobile](https://camo.githubusercontent.com/9a9d78e8b62589a661e5062fd46ff3861c1e91cb270ec7b32a3209c53fe5483a/68747470733a2f2f676974746572646f632e636f6d2f4769744875622f7061676573706565645f6d6f62696c652e706e67)](https://camo.githubusercontent.com/9a9d78e8b62589a661e5062fd46ff3861c1e91cb270ec7b32a3209c53fe5483a/68747470733a2f2f676974746572646f632e636f6d2f4769744875622f7061676573706565645f6d6f62696c652e706e67)

📚 Installation
--------------

[](#books-installation)

Go to your root directory of your laravel project and install the package with composer:

```
$ composer require gitterdoc/critical
```

And add the configuration's file to your laravel instance:

```
$ php artisan vendor:publish --provider="gitterdoc\Critical\Install"
```

💡 Usage
-------

[](#bulb-usage)

Go into your `Blade` template and replace your `Stylesheets` and add the same to the end of the body by expecting the second parameter!

```
>

        {{ critical('css/app.css', true) }}

        {{ critical('css/app.css', false) }}

```

🔨 API
-----

[](#hammer-api)

### `{{ critical($file, $type) }}`

[](#-criticalfile-type-)

This method will handle your stylesheets.

**Parameter****Type****Default****Description**$file`String`**required**The stylesheet, that will be handled$type`boolean``true`It's an include for your header or your footer? (header = `true`, footer = `false`)🔧 Settings
----------

[](#wrench-settings)

You can change the settings on the `config/critical.php` file.

**Name****Type****Default****env****Description**✅**enabled**`boolean``true``CRITICAL_ENABLED`Enable or disable the Critical module📝**onlyprint**`boolean``true``CRITICAL_ONLY_PRINT`Describes the handling - `true` - Only stylesheets will be printed, no more handling - `false` - Each site request will be parsed to find specific styles⚡**caching**`Array`**enabled**`boolean``true``CRITICAL_CACHE_ENABLED`Enable or disable the caching**time**`integer``3600``CRITICAL_CACHE_TIME`Set the maximal cache lifetime of the cache in seconds (3600 = 1 hr)📜**noscript**`boolean``true``CRITICAL_NOSCRIPT`Adding original stylesheet as `` for browsers, that don't have JavaScript enabled🔥 Support us!
-------------

[](#fire-support-us)

I'm a excellent and professional web- &amp; software developer but i don't work anymore in these branche. I spend some free time to create awesome content. Support me by **liking my repositorys** 😍 or spend me a coffee ☕!

---

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2856d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e82a2ec5a99801b80529d95e3ef2e0b0bd26bd2c65552ea4759efd6e65e30460?d=identicon)[gitterdoc](/maintainers/gitterdoc)

---

Top Contributors

[![gitterdoc](https://avatars.githubusercontent.com/u/41349716?v=4)](https://github.com/gitterdoc "gitterdoc (8 commits)")

---

Tags

above-the-foldcritical-csscritical-path-csscritical-path-styleslaravellaravel-packagestylestylesheetPageSpeedAbove the foldcriticalgitterdoc

### Embed Badge

![Health badge](/badges/gitterdoc-critical/health.svg)

```
[![Health](https://phpackages.com/badges/gitterdoc-critical/health.svg)](https://phpackages.com/packages/gitterdoc-critical)
```

###  Alternatives

[scssphp/scssphp

scssphp is a compiler for SCSS written in PHP.

62827.7M220](/packages/scssphp-scssphp)[wikimedia/less.php

PHP port of the LESS processor

12327.4M77](/packages/wikimedia-lessphp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
