---
title: 'Loading CSS in a custom plugin'
url: 'https://getgrav.org/forum/plugins/loading-css-in-a-custom-plugin-t6955'
markdown: 'https://getgrav.org/forum/plugins/loading-css-in-a-custom-plugin-t6955.md'
date: '2026-06-21'
description: "How should CSS be loaded correctly in a custom plugin? I've a function onAssetsInitialized which is already loading JS successfully in the plugin. And am"
---

[Plugins](https://getgrav.org/forum/plugins)

#   Loading CSS in a custom plugin 

 [plugin](https://getgrav.org/forum/tag/plugin) [plugins](https://getgrav.org/forum/tag/plugins)

 Solved by Geoff Jackson [View solution](https://getgrav.org/forum/plugins/loading-css-in-a-custom-plugin-t6955#post-31648)

  Started by Geoff Jackson 6 years ago · 1 replies · 1177 views    

 [6 years ago](https://getgrav.org/forum/plugins/loading-css-in-a-custom-plugin-t6955#post-31647 "Permalink") 

How should CSS be loaded correctly in a custom plugin?

I've a function `onAssetsInitialized` which is already loading JS successfully in the plugin.

And am trying to load like the below but this isn't doing anything...

`$assets->addCss('plugins://paypal-checkout/assets/paypal-checkout.css');`

 [6 years ago](https://getgrav.org/forum/plugins/loading-css-in-a-custom-plugin-t6955#post-31648 "Permalink")  Solution 

Ah never mind. This is actually now loading.

I don't know why it wasn't a minute ago.

[Log in](https://getgrav.org/login?return=%2Fforum%2Fplugins%2Floading-css-in-a-custom-plugin-t6955) to reply.

###  Suggested topics

 | Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| [Conflict with updated Form plugin and Add Page By Form](https://getgrav.org/forum/plugins/conflict-with-updated-form-plugin-and-add-page-by-form-t9480)    [Plugins](https://getgrav.org/forum/plugins) · by DrPen, 2 weeks ago |  | 2 | 216 | [2 weeks ago](https://getgrav.org/forum/plugins/conflict-with-updated-form-plugin-and-add-page-by-form-t9480 "by DrPen") |
| [grav-mcp update\_page sends lang in the body instead of the query string, so non-default languages are never updated](https://getgrav.org/forum/plugins/grav-mcp-update-page-sends-lang-in-the-body-instead-of-the-query-string-so-non-default-languages-are-never-updated-t9469)    [Plugins](https://getgrav.org/forum/plugins) · by renedebaaij, 3 weeks ago |  | 1 | 225 | [2 weeks ago](https://getgrav.org/forum/plugins/grav-mcp-update-page-sends-lang-in-the-body-instead-of-the-query-string-so-non-default-languages-are-never-updated-t9469 "by Andy Miller") |
| [Tools / Scheduler some jobs not running.](https://getgrav.org/forum/plugins/tools-scheduler-some-jobs-not-running-t9471)    [Plugins](https://getgrav.org/forum/plugins) · by Thomas, 3 weeks ago |  | 1 | 229 | [3 weeks ago](https://getgrav.org/forum/plugins/tools-scheduler-some-jobs-not-running-t9471 "by Thomas") |
| [How to clone a flex object in twig](https://getgrav.org/forum/plugins/how-to-clone-a-flex-object-in-twig-t9438)    [Plugins](https://getgrav.org/forum/plugins) · by complanar, 1 month ago |  | 6 | 554 | [1 month ago](https://getgrav.org/forum/plugins/how-to-clone-a-flex-object-in-twig-t9438 "by complanar") |
| [Integration of GRAV articles into my principal website](https://getgrav.org/forum/plugins/integration-of-grav-articles-into-my-principal-website-t9440)    [Plugins](https://getgrav.org/forum/plugins) · by BenLaKnet, 1 month ago |  | 1 | 418 | [1 month ago](https://getgrav.org/forum/plugins/integration-of-grav-articles-into-my-principal-website-t9440 "by BenLaKnet") |
