I’m currently working on customizing the base Casper theme (v 2.10.3).
Any changes I make to .hbs files update live in the browser, but any changes I make to the CSS files aren’t upadating, even if I stop and start ghost. Is there something I’m missing that needs to be done to build the CSS files?
Howdy there @macreddin
It depends on the theme you’re editing and what build tools it’s using to create the CSS. I’m guessing you might be trying to edit Casper? If so then Casper has a specific build process which you can read up about in it’s own readme file on GitHub:
We’ve recently added a tutorial on how to use Gulp with Ghost themes. Gulp is the tool we use to help with compiling our CSS and JavaScript in themes such as Casper. The following tutorial explains how you can use it when editing Ghost themes and how to use it yourself from scratch:
You only need to run npm install once to download the necessary dependencies in each theme. After that, just run npm run zip whenever you’re making stylistic changes and want to upload a new version of your theme.
All that’s left to do now is to upload the zip file in Ghost Admin. Refresh your site and voilà – your changes are active!
So do I understand correctly that there is no real-time way to see the changes you make to your css file in your local environment at your http://localhost:2368/ ? In fact, I can not even gulp and see the changes locally. I actually have to create a zip file and upload it from the portal (again running locally) for each small change I make?
This does not make any sense if this is really how local development or small code editing works. I must be missing something here.
You can absolutely see changes live. Run ‘gulp’ (not ‘gulp zip’) within the theme folder and it’ll live update. (You’ll still need to reload the page in the browser.
I do it all the time on my local dev install. Works great.
I have gulp running in my theme and can’t see any change on browser reload. only the structural changes within *.hbs, but csswatcher doesn’t seem to work at all.
it only works when I run