0

I have the following code in my default theme in grav after a fresh install , the code resides in the in base.html.twig file which is basically a partial , that gets used in other twig templates like so:

{% extends 'partials/base.html.twig' %}

{% block content %}
    {{ page.content }}
{% endblock %}

ISSUE/PROBLEM STATEMENT: So i have the following css being loaded in my base.html.twig , but when i check loaded page i don't see the css/custom.css file , why is this so ? why is the custom.css file not being loaded ?

{% block stylesheets %}
    {% do assets.addCss('theme://css/pure-0.5.0/grids-min.css', 103) %}
    {% do assets.addCss('theme://css-compiled/nucleus.css', 102) %}
    {% do assets.addCss('theme://css-compiled/template.css', 101) %}
    {% do assets.addCss('theme://css/custom.css', 100) %}
    {% do assets.addCss('theme://css/font-awesome.min.css', 100) %}
    {% do assets.addCss('theme://css/slidebars.min.css') %}

    {% if browser.getBrowser == 'msie' and browser.getVersion == 10 %}
        {% do assets.addCss('theme://css/nucleus-ie10.css') %}
    {% endif %}
    {% if browser.getBrowser == 'msie' and browser.getVersion >= 8 and browser.getVersion <= 9 %}
        {% do assets.addCss('theme://css/nucleus-ie9.css') %}
        {% do assets.addJs('theme://js/html5shiv-printshiv.min.js') %}
    {% endif %}
{% endblock %}
{{ assets.css() }}
Alexander Solonik
  • 9,838
  • 18
  • 76
  • 174

2 Answers2

2

It's probably a caching issue and you might need to disable caching for the parent or sub page. See this issue on GitHub.

0

Turns out the file css/custom.css does't exists in the css directory , creating this file solved the issue.

NOTE::- in a default .html file the non-existent css file would still be loaded , but seems grav won't load a non-existent file !

Alexander Solonik
  • 9,838
  • 18
  • 76
  • 174