Custom CSS file

Hi Guys,

Just wondering if there’s a way to implement a custom css file for Grav to save editing the template.css file and having it overridden when upgrading?

Love the system by the way.

That’s actually a good idea. It would need to be implemented in the antimatter theme, just an asset loading a custom.css file. I’ll take a look tomorrow.

Ok i’ve added this in the Antimatter partials/base.html.twig file:

        {% do assets.addCss('theme://css/custom.css',100) %}

It will be in the next release. It did expose a bug with missing resources though, and that is fixed and will be in the next release of Grav.

Awesome! That will be a very welcome addition! Cheers guys.

The release is out BTW, so if you add that line, or update Antimatter theme, make sure you do an update on Grav too: $ bin/gpm selfupgrade

Cool…I now have a couple of Grav installs to update. Loving the system guys and the release schedule for updates is phenomenal!

Hi rhukster - I’ve tried adding this code but it doesn’t seem to want to take. Do I put the custom CSS file in the css, css-compiled or scss folder…I’ve tried all three but the system isn’t picking up my custom css code.

Antmatter has been updated with this already, but if you added it yourself, then it would look for the file in the css folder. Specifically it’s looking for a file of the name:

/user/themes/antimatter/css/custom.css

If you have that file there it should find it and add it. Maybe you should just update antimatter to ensure you have put the call in the right place?