# Editing Casper Theme CSS vs Code Injection

**URL:** <https://forum.ghost.org/t/editing-casper-theme-css-vs-code-injection/28041>\
**Category:** Themes\
**Created:** [January 21, 2022, 10:36am UTC](https://forum.ghost.org/t/editing-casper-theme-css-vs-code-injection/28041 "2022-01-21T10:36:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hakan](https://avatars.discourse-cdn.com/v4/letter/h/f1d935/32.png) [@hakan](https://forum.ghost.org/u/hakan)\
**Post date:** [January 21, 2022, 10:36am UTC](https://forum.ghost.org/t/editing-casper-theme-css-vs-code-injection/28041/1 "2022-01-21T10:36:04Z")

</div>

Hey all,

I’m going to make some drastic changes to the Casper theme, I’m editing files for layout changes, new partials, etc. It is all good.

However I had some problems with GULP while editing CSS files. Then I saw Code Injection section. Is Code Injection the recommended way to edit CSS? Is there any benefits to edit CSS files. I lean more into CSS editing, however happy to use Code Injection if for some reason it is recommended.

Thank you

---

<div class="post-metadata">

**Author:** ![Jesus\_Esquivel\_Roman](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jesus_esquivel_roman/32/16110_2.png) [@Jesus\_Esquivel\_Roman](https://forum.ghost.org/u/Jesus_Esquivel_Roman)\
**Post date:** [February 2, 2022, 10:42pm UTC](https://forum.ghost.org/t/editing-casper-theme-css-vs-code-injection/28041/2 "2022-02-02T22:42:37Z")

</div>

You can create a custom.css file under theme \> assets \> file-name.css. You can add all the custom css you want there, just make sure you link it in your default.hbs header like so `<link rel="stylesheet" type="text/css" href="{{asset "css/custom.css"}}" />`. Make sure you `ghost restart` when you first create this file or if you make any changes to this file to see your changes

You can also use the code injection altough I wouldn’t recommend it.

---

<div class="post-metadata">

**Author:** ![umbergerba](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/umbergerba/32/16822_2.png) [@umbergerba](https://forum.ghost.org/u/umbergerba)\
**Post date:** [February 17, 2022, 10:08pm UTC](https://forum.ghost.org/t/editing-casper-theme-css-vs-code-injection/28041/3 "2022-02-17T22:08:04Z")

</div>

Thanks a bunch for this, all other instructions I found in the forum failed to work, but this did!

> [@Jesus\_Esquivel\_Roman](#):
>
> … just make sure you link it in your default.hbs header like so `<link rel="stylesheet" type="text/css" href="{{asset "css/custom.css"}}" />`

Actually, it’s best to add the “link” code to “Settings \> Code injection”; simpler and less likely to be overwritten, plus restart shouldn’t be neccessary then.
