Black Friday Sale! Get up to $30 off GP Premium! Learn more ➝

[Resolved] Internal inline CSS vs External

Home Forums Support [Resolved] Internal inline CSS vs External

Home Forums Support Internal inline CSS vs External

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #225033
    Lyle

    Hi Tom,

    I noticed early on in using GP that a lot of the CSS is internal/inline within the page. Seems to be most if not all of the Customizer settings. Never really thought much about it until someone in the BB FB group, while discussing the Elementor pagebuilder, mentioned that this method is not very efficient as opposed to minifying into an external file.

    Just curious as to what your thoughts are on this subject.

    Cheers!
    Lyle

    http://snifflevalve.com
    Tutorials and tips for GeneratePress, WP Show Posts, WordPress and Elementor

    #225045
    Tom
    Lead Developer
    Lead Developer

    Hi Lyle,

    I’ve looked into it a lot, and while it would arguably be better to have it in an external file, it doesn’t make that huge of a difference.

    Since that CSS is generated by your options in the Customizer, they can’t be written to an external file without some hacky PHP, which would hurt performance more than help it.

    If I ever find an efficient way to write it to a file, I’ll be all over it.

    However, you can use a plugin like Autoptimize which will move all of that CSS into an external file.

    That’s what I suggest here: https://generatepress.com/fastest-wordpress-theme

    Let me know if you need more info πŸ™‚

    #225048
    Lyle

    Thanks Tom. I have used the items in the link and they do make a measureable difference πŸ™‚

    http://snifflevalve.com
    Tutorials and tips for GeneratePress, WP Show Posts, WordPress and Elementor

    #225107
    Tom
    Lead Developer
    Lead Developer
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.