- This topic has 13 replies, 3 voices, and was last updated 4 years ago by
Tom.
-
AuthorPosts
-
March 20, 2019 at 6:01 am #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.2GP Premium 1.7.8March 20, 2019 at 7:32 am #844598David
StaffCustomer SupportHi 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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 20, 2019 at 8:05 am #844635Daniel
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?
March 20, 2019 at 8:10 am #844641David
StaffCustomer SupportThis 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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 20, 2019 at 8:13 am #844645Daniel
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?
March 20, 2019 at 8:18 am #844650David
StaffCustomer SupportUnless they are from a legacy install where FA icons were in use and the theme was updated, they shouldn’t be there.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 20, 2019 at 9:12 am #844713Daniel
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!
March 20, 2019 at 9:15 am #844723Tom
Lead DeveloperLead DeveloperHi 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”.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 20, 2019 at 9:31 am #844741Daniel
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
March 20, 2019 at 11:51 am #844895Daniel
Just out of curiosity – How come I don’t see a general.php file within my child theme?
March 20, 2019 at 1:53 pm #844981Daniel
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'); }
March 20, 2019 at 3:49 pm #845019Tom
Lead DeveloperLead DeveloperIt 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#L22It’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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 20, 2019 at 4:24 pm #845040Daniel
Thanks Tom. Much appreciated!!
March 20, 2019 at 4:41 pm #845056Tom
Lead DeveloperLead DeveloperNo problem – sorry I couldn’t be more helpful! 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.