EnlighterJS / Plugin.WordPress

:package: Official WordPress Plugin of EnlighterJS
http://wordpress.org/plugins/enlighter/
GNU General Public License v2.0
115 stars 18 forks source link

enlighterjs.min.css loaded on all page even if not used #259

Closed cedricwalter closed 4 years ago

cedricwalter commented 4 years ago

Hi,

while profiling I discovered that enlighterjs.min.css is loaded on home, and everywhere even if not used....

Your scripts are useful for what your plugin or theme does in a specific place, but including them into pages where they are not needed will make this same pages unnecessarily heavier.

Wordpress has a solution for that, can you please implement it?

AndiDittrich commented 4 years ago

use the DRI feature within Enlighter settings

cedricwalter commented 4 years ago

thanks

AndiDittrich commented 4 years ago

but please keep in mind that the DRI can only optimize the (much larger) javascript file loading - css files cannot be limited by the DRI (see the old issue here for technical details).

WordPress has no build-in solution to achieve this.

if you want to optimize the css size it is recommended to use a single EnlighterJS theme (from the official repository) and add it to your theme styles - then you can disable the "full" theme pack