• Resolved Rookie

    (@alriksson)


    Possibility to load site-reviews-inline-css as static file async/defer in the footer.

    In my case this css is not priority to load inline. It is used in the end of the post only meaning I would not like tompriorize to render this css above the fold in the <head>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Gemini Labs

    (@geminilabs)

    The inline css is generated on page load, it contains the background image URLs for the stars. This CSS will remain as removing it would introduce a breaking change.

    Site Reviews uses the wp_add_inline_style function which automatically inserts the inline CSS after the Site Reviews stylesheet. In order to move the position of the inline CSS you would need to move the position of the main stylesheet. However, as explained here, it is not best practice to move stylesheets outside of the head tag:

    A <link> element can occur either in the <head> or <body> element, depending on whether it has a link type that is body-ok. For example, the stylesheet link type is body-ok, and therefore <link rel=”stylesheet”> is permitted in the body. However, this isn’t a good practice to follow; it makes more sense to separate your <link> elements from your body content, putting them in the <head>.

    If you wish to add additional attributes to the stylesheet link tag (i.e. rel="preload"), use the style_loader_tag WordPress hook.

    • This reply was modified 4 years, 11 months ago by Gemini Labs.
    Thread Starter Rookie

    (@alriksson)

    Sure you have a valid point. But regarding loading in <head> I was more referring to add async or defer once it’s loaded in the main file.

    But I could understand the technicalities thanks for the extended answer.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘site-reviews-inline-css as static file’ is closed to new replies.