WP Manifestindependent plugin directory
manifest / performance / themosis-criticalcss

Themosis Critical CSS archived

A WordPress plugin for Themosis that provides a WP CLI method to generate critical CSS.

by Daniel Gadd @ Keltie Cochrane Ltd. · github.com/djgadd/themosis-criticalcss · website

3stars
8composer installs
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/djgadd/themosis-criticalcss/archive/refs/heads/master.zip

Also on Packagist as djgadd/themosis-criticalcss:

composer require djgadd/themosis-criticalcss

From the readme

Themosis Critical CSS 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 Y

Read the full README on GitHub →