Muut
November 19, 2015, 10:47pm
1
Hi Guys,
Trying to get some custom CSS to work for a Grav install using the Agency template. I’ve tried adding a -custom.css file in the CSS folder within the template, I’ve also tried setting up theme inheritance and adding the css files there, also tried adding the scss files in there but to no avail.
Am I missing something here? How can I add custom css (without it being overridden on upgrade)?
Many thanks guys.
Muut
November 20, 2015, 1:08am
2
It appears Agency doesn’t have a line to add a custom.css file if found like Antimatter does. You can add it like this:
{% include 'partials/metadata.html.twig' %}
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="icon" type="image/png" href="{{ url('theme://images/favicon.png') }}" />
<link rel="canonical" href="{{ page.url(true, true) }}" />
{% 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 %}
But probably should submit an issue to get it added to the official version so your changes are not lost.
Muut
November 20, 2015, 1:38am
3
Thanks rhukster - Have just added a request. Thanks for your speedy assistance.