But I noticed the same issue in other themes as well - for example in Atilla theme, I try to modify width property by changing its value from 100% to 50%:
Where are you getting the .blog-cover class selector from? As far as I can tell by looking at the demo site for the Attila theme, .blog-cover isn’t used anywhere in the HTML, so that would be why targeting that selector is not creating any changes on your site.
Note that different themes will use different classes, IDs etc. (the names of classes and IDs aren’t formally standardized and are simply chosen by whoever develops the theme) so you need to ensure that you find and target the correct selector when trying to modify CSS properties.
As an aside, you will occasionally find that you may need to use or find it useful to use !important when trying to override existing CSS e.g. width: 50% !important; however that would certainly not be the case here.
This will rather just be a case of finding and targeting the correct selector.
In the second screenshot you’ve attached
You can see in the top right style.css:1 - that’s telling you that this CSS is coming from your custom style sheet (and of course the 1 indicates that .blog-cover is on line 1). So by that, I mean, it’s not an indication that .blog-cover actually exists in the HTML of the Attila theme or its CSS.
To be honest though, I’m not entirely sure why it’s showing width: 100%; if you’ve set it to width: 50%; in your code injection… that’s a bit of an anomaly to me. I’m not an expert though.
Anyway, if you tell or show me which part of the Attila theme you are trying to change, I can help you find the correct selector and code to accomplish that goal.
Yes, I’m using Attila theme and this .blog-cover property is found in /src/sass/style.scss file.
I chose to modify this property because it was highlighted when I was inspecting my site with Developer Tools in Mozilla.
I’m aware that there is another CSS file located in /assets/css/style.css but the contents of this file are not properly formatted - I assmue it is by design so that users won’t tinker with it.
Here is the fragment of /src/sass/style.scss file:
I think the missing component in this issue is the tutorial itself. I’m not sure why it was taken down.
Many themes for Ghost are built using Gulp. Gulp is a tool for processing files, most commonly front-end files such as CSS and JavaScript. While Ghost can use CSS and JavaScript files without any modification sometimes these files can get a bit large, so breaking these files into smaller ones and letting Gulp merge them together can really help.
The large /assets/css/style.css file you’re seeing is what Gulp spat out. Files that end in .scss are most likely the source files for Gulp. These are the files you should edit. Casper has development instructions on how to work locally and edit the theme code:
Note: I would always recommend using code injection for minor CSS and JavaScript tweaks. It’s much easier to drop in minor tweaks than committing o editing the theme itself.
All I had to do was to run a “gulp sass” task, modify the “style.scss” and refresh the website.
I mean, how difficult is it to remark somewhere in the official documentation that “in order to edit CSS files you have to create a task in Gulp/Grunt”. Even the “veterans” of this forum couldn’t figure this out.