How to use standard_header_includes without loading layout.css

Hi @tkruger, you can set your own variable to be equal to “standard_header_includes”, then loop through every line in the variable and if it includes the CSS file then don’t add it to your template.

Something like this:

{% set custom_header_includes = standard_header_includes|split('\n') %}

{% for line in custom_header_includes %}

 {% unless line is string_containing 'the-file-to-exclude.css' %}
 {{line}}
 {% endunless %}

{% endfor %}

By doing this you would be adding all the necessary code except the CSS.

We do something similar in several of our pages and it works for us.

Hope this helps!