Site logo

Archived topic

Using my own framework and performance

13 replies · Started by Daniel on March 20, 2019

Viewing posts 1–14 of 14

Hi Support Team,

First of all, just want to say thank you for making such a great product. I have been having a lot of fun playing around with gp!

One question I have today is would having a lot of css severely impact the performance? So let’s say that I were to build a website using only one HTML block per page and style them all with my own custom css / framework in a child theme, would doing this severely impact the performance as there is already a lot of css for the generate press grid and so on?

Thank you,

Hi there,

i wouldn't think so. Depending on how much CSS you throw at it will make a difference, but unless you are into thousands of lines of CSS i doubt you'll notice it.

Appreciate your prompt reply.

Is there a way to properly undo enqueueing of some of the parent theme css stylesheets?

Notably the font-awesome.css and unsemantic-grid.css?

Ok thank you for the link. I will check it out.

Hmm that is strange. My current setup is a local installation of just generatepress and the premium plugin with no other plugins and the font awesome stuff is located within the generatepress theme folder. Could there be any other reasons?

Unless they are from a legacy install where FA icons were in use and the theme was updated, they shouldn't be there.

Ok my apologies to keep bugging you but I am afraid I have virtually zero knowledge of php... In which file would I place the snippet for dequeueing and exactly how would I write it? My goal is to dequeue the "unsemantic-grid.css" and "unsemantic-grid.min.css"

Many thanks!

Hi there,

If you dequeue those files, the structure of the theme will break. I definitely don't recommend doing that unless you're an advanced user that has a replacement stylesheet with all of those necessary classes ready to go.

As for Font Awesome, you can make sure "Load Font Awesome Essentials" is checked in "Customize > General".

Yes - the reason for wanting to dequeue is I have my own framework that I would like to use. Basically I am just using one html block per page and writing out all the html and necessary classes in there myself and realized that the only thing I probably need from unsemantic is maybe the grid-container and that’s it.

It all comes down to emphasis on improving performance that’s all. I fear that I have too much unused css that may hinder the performance.

Thanks

Just out of curiosity - How come I don't see a general.php file within my child theme?

I added the following to my child theme functions.php and it still seems to be loading unsemantic stylesheet. Is there something more I should be adding?

add_action('wp_enqueue_scripts', 'generate_remove_scripts');
function generate_remove_scripts()
{
	wp_dequeue_style('generate-style-grid');
}

It should be as simple as this:

add_action( 'wp_print_styles', function() {
	wp_deregister_style( 'generate-style-grid' );
} );

Unfortunately, it doesn't work because generate-style has it listed as a dependency: https://github.com/tomusborne/generatepress/blob/2.2.2/inc/general.php#L22

It's not possible to remove dependencies via filter, unfortunately. This is likely something we should remove from the theme entirely.

I'll make a note to do this in GP 2.3.

Thanks Tom. Much appreciated!!

No problem - sorry I couldn't be more helpful! :)

This archived topic is closed to new replies.