2017 © Pedro PelĂĄez
 

library critical

Laravel provider that will extract critical CSS.

image

gitterdoc/critical

Laravel provider that will extract critical CSS.

  • Saturday, July 21, 2018
  • by gitterdoc
  • Repository
  • 0 Watchers
  • 1 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

:boom: How it work's?

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!, (*1)

google PageSpeed: Desktop google PageSpeed: Mobile, (*2)

:books: Installation

Go to your root directory of your laravel project and install the package with composer:, (*3)

$ composer require gitterdoc/critical

And add the configuration's file to your laravel instance:, (*4)

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

: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!, (*5)

<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
    <head>
        <!-- OLD -->
        <!--<link href="{{ asset('css/app.css') }}" rel="stylesheet" />-->

        <!-- To your header -->
        {{ critical('css/app.css', true) }}

        <!-- //
 -->
    </head>
    <body>
        <!-- //
 -->

        <!-- To your footer -->
        {{ critical('css/app.css', false) }}
    </body>
</html>

:hammer: API

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

This method will handle your stylesheets., (*6)

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)

:wrench: Settings

You can change the settings on the config/critical.php file., (*7)

Name Type Default env Description
:white_check_mark: enabled boolean true CRITICAL_ENABLED Enable or disable the Critical module
:memo: 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
:zap: 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)
:scroll: noscript boolean true CRITICAL_NOSCRIPT Adding original stylesheet as <noscript> for browsers, that don't have JavaScript enabled |

:fire: Support us!

I'm a excellent and professional web- & 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 :heart_eyes: or spend me a coffee :coffee:!, (*8)


<, (*9)

table width="100%"> , (*10)

https://packagist.org/packages/gitterdoc/critical https://gitterdoc.com

The Versions

21/07 2018

dev-master

9999999-dev https://gitterdoc.com/

Laravel provider that will extract critical CSS.

  Sources   Download

MIT

The Requires

 

by Adrian Preuß

critical stylesheet pagespeed gitterdoc above the fold

20/07 2018

1.0.0

1.0.0.0 https://gitterdoc.com/

Laravel provider that will extract critical CSS.

  Sources   Download

MIT

The Requires

 

by Adrian Preuß

critical stylesheet pagespeed gitterdoc above the fold