djgadd/themosis-criticalcss

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (0.2.7) of this package.

A themosis plugin that generates critical CSS

Installs: 7

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 1

Forks: 0

Open Issues: 1

Type:wordpress-plugin

0.2.7 2018-02-01 15:40 UTC

README

A WordPress plugin for Themosis that implements kalfheim/critical-css to generate critical CSS in WordPress. You'll need to have wp-cli setup to run it, and it'll also need to be present in production to new/changed posts. Also relies on keltiecochrane/themosis-illuminate implementation of config and files, and uses keltiecochrane/themosis-logger for logging.

It will generate CSS for mobile, tablet and desktop devices, which will be served as appropriate by browser sniffing. It will automatically modify style tags to set them to rel="preload" and uses loadCSS to polyfill browsers that don't support preloading.

This plugin will set a cookie to determine users that have/haven't been served the CSS previously (to avoid inflated page loads for users that have a cached copy of your CSS.) You may need to add a notice or override this functionality as is appropriate to local laws regarding cookies.

Install

From your projects base path run: -

npm install critical --save

Require the package in composer: -

composer require keltiecochrane/themosis-criticalcss

Copy the config/criticalcss.php file into your config folder.

Activate the plugin in WordPress.

Use

You'll need to have wp-cli installed, to generate CSS run: -

wp critical-css generate

To clear generated CSS run: -

wp critical-css clear

Support

This plugin is provided as is, though we'll endeavour to help where we can.

Contributing

Any contributions would be encouraged and much appreciated, you can contribute by: -

  • Reporting bugs
  • Suggesting features
  • Sending pull requests