Support

Account

Home Forums Gutenberg CSS performance Reply To: CSS performance

  • This is not specific to blocks or classic editor. For performance the best choice is to include local inline CSS for small chunks of CSS code that may or may not be needed when the page is generated.

    I realize this is counter-intuitive for most of us old school developers and it took me a while to accept as well.

    Multiple small CSS files == bad for performance
    Large CSS with styles that are not used == bad for performance
    Inline CSS == better for performance.

    So in the same file where you are generating the HTML you just add <style> ..... </style>. Even better if you do so in a way that only includes this once per page if the same code is called more than once.