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.

Themes & Styling

Custom.css not working at all with default quark theme

Started by eurico roberto 3 years ago · 5 replies · 483 views
3 years ago

Following the instructions in your documentation (https://learn.getgrav.org/17/themes/customization) I created public_html/user/themes/quark/css/custom.css

Did not work at all even though custom.css appears in the source code, and yes I tried clearing cache.

After spending almost an hour trying to get it to work I found that a custom css plugin exists, which actually does work.

Could someone please enlighten me why it wasn't working without the plugin?

Cheers.

3 years ago

@eurico,

Could someone please enlighten me why it wasn’t working without the plugin?

Only if you share exactly which steps you've taken...

When I follow the directions in section Custom CSS, it works out of the box without any plugin.

  • Fresh install of the latest Grav
  • Edit already existing file /user/themes/quark/css/custom.css and add:
    CSS
    p {
    color: red;
    }
    
  • Point the browser at the Grav site and all paragraphs are in red.
3 years ago

@eurico,

I did exactly what you did.

Starting with a fresh install of Grav? Or were their prior changes?

and yes I tried clearing cache

Which one? Grav's cache, or the browser's cache?

  • Did you force the browser to refresh?
  • If still not working, try to refresh the cache of Grav.
  • Is file /user/themes/quark/css/custom.css loaded in the browser? Does it contain the correct styling?
3 years ago

Starting with a fresh install of Grav? Or were their prior changes?

Yes. I did EXACTLY what you did.

Which one? Grav’s cache, or the browser’s cache? Did you force the browser to refresh?

Yes. Also Cloudflare cache purged. Also tried different browsers.

If still not working, try to refresh the cache of Grav.

I already did. Didn't help.

Is file /user/themes/quark/css/custom.css loaded in the browser? Does it contain the correct styling?

Yes. And no, if it did it there would be no problem.

Anyway the plugin seems to do the job now, so I've moved on and am testing other things.

Have a great day!

3 years ago

@eurico, Have you tried loading your custom.css file with higher priority over other styles documents? For example:

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

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Pedro M, 2 months ago
4 202 2 months ago
Themes & Styling · by Ian, 2 months ago
3 98 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 461 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 52 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 132 3 months ago