Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Archive

Custom CSS file

Started by Muut Archive 12 years ago · 7 replies · 428 views
12 years ago

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.

12 years ago

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.

12 years ago

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

TWIG
        {% 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.

12 years ago

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

12 years ago

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

12 years ago

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

12 years ago

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.

12 years ago

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:

TXT
/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?

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1280 9 years ago
Archive · by Muut Archive, 9 years ago
2 888 9 years ago
Archive · by Muut Archive, 9 years ago
2 4018 9 years ago
Archive · by Muut Archive, 9 years ago
1 2893 9 years ago
Archive · by Muut Archive, 9 years ago
3 1077 9 years ago