[Support request] Using my own framework and performance

Home Forums Support [Support request] Using my own framework and performance

Home Forums Support Using my own framework and performance

  • This topic has 13 replies, 3 voices, and was last updated 4 years ago by Tom.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #844356
    Daniel

    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,

    GeneratePress 2.2.2
    GP Premium 1.7.8
    #844598
    David
    Staff
    Customer Support

    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.

    #844635
    Daniel

    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?

    #844641
    David
    Staff
    Customer Support

    This article explains how to remove:

    https://codex.wordpress.org/Function_Reference/wp_dequeue_style

    Just note that things like grid-parent and grid-container classes relies on unsemantic.

    GP doesn’t add font awesome so that must be coming from another plugin.

    #844645
    Daniel

    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?

    #844650
    David
    Staff
    Customer Support

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

    #844713
    Daniel

    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!

    #844723
    Tom
    Lead Developer
    Lead Developer

    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”.

    #844741
    Daniel

    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

    #844895
    Daniel

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

    #844981
    Daniel

    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');
    }
    #845019
    Tom
    Lead Developer
    Lead Developer

    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.

    #845040
    Daniel

    Thanks Tom. Much appreciated!!

    #845056
    Tom
    Lead Developer
    Lead Developer

    No problem – sorry I couldn’t be more helpful! 🙂

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.