If you’ve ever listen to me talk about coding for more than five minutes, you know that I absolutely loathe letting machines code for me, or even just using someone else’s code base. I’m very Type-A about code output – I want to make sure it’s semantic, accessible, and organized well – not just for me, but for the devs who come after.
However, this level of control is not always possible, especially for closed systems like Shopify. While you can control much of the front-end theming, there are so many limitations that it’s best to not stress yourself out too much here. Many Shopify clients are on a small budget, so theming on top of a premade theme is often necessary. (Again, I do not support this for open CMS’s like WordPress, because you can 100% control all of the outputted code).
The upside to this is that it’s cheaper and faster to finish a full theme. Building on top of a free theme means most of the responsiveness and bugs are worked out already, and it helps you maintain full theme editability for the client. The downside, of course, is that you don’t really control the code output and this can often affect semantics and accessibility if the starter theme you’re using doesn’t include this from the get-go.
Why Dwell?
I choose to use Shopify’s Dwell theme for the starting point of all my Shopify themes. It’s a basic eCommerce theme that doesn’t have too much unnecessary junk, making it a great jumping off point. It’s easy to add or remove sections or features you don’t want or need, and to customize the look of existing modules. The theme is easy enough to navigate, and while I don’t edit Shopify locally or use Git (I know, I know), their editor makes it easy enough to jump in and out – and honestly there’s not too much coding to be done for these themes beyond CSS anyways.
Here’s a look at my process for making Shopify themes:
Custom color schemes
The first thing I do is to go into the Colors section in settings and delete all the ones that come with Dwell. We want to both avoid confusion for us and the clients, while also avoiding someone accidentally choosing a color scheme that doesn’t match the brand colors. I go ahead and start creating my own up front for the different color sections, but this is often something I’ll come back to multiple times throughout the project to add or adjust.
Here you can see all the different color theme sets on the left, and how you can customize on the right.
Custom Fonts
Another easy way to set your theme apart from the regular premade look is to add in custom fonts. This can be done either by uploading your fonts to your files section and calling it from the base.css stylesheet – or adding it to the header.liquid template if it’s a Google or Adobe font.
Here’s a custom font I added by uploading the font to the Files area of Shopify and calling it via @font-face
This is where things start to get a lil messy because your font choices in the Typography settings section will be overridden in the CSS, which means it becomes a little useless.
We’ll continue to use the sizes and styles here, but the Fonts section becomes useless if you add your own fonts. That’s okay.
Module-level CSS vs Theme CSS
One of the most annoying aspects of Shopify theming is that you sort of have to split your CSS between module-level in the settings panel, and code level in base.css. This is due to the fact that the modules are reusable and also lack a specific class to skin them with. (OK OK there are ID’s like shopify-section-template–22112911753465__section_Xf6abM but I don’t trust those for a minute to never change or break stuff).
You can get around this by adding CSS to the Custom CSS area in the bottom right editor panel when you’ve opened a section. The good thing about doing this is that this CSS will only affect this particular module (and even if you use the same module elsewhere, it won’t be affected)
It’s ugly, it’s nasty, it gets the job done.
The biggest annoying downside to adding your CSS here is that you’re limited in what CSS you can add. For example, pseudo selectors like :before or :after aren’t allowed. Why?? Who knows! You have to then put it in the base.css file. But if there’s no unique way to style each module, how do we do this you ask? WE HACK IT!
My aim is to have 99% of the CSS in the actual CSS file – I could get it to 100% if I added a class field (see below) to each module, but often this isn’t an economical use of small budgets.
Adding custom module fields for classes
Just because we’re using a premade theme, doesn’t mean we can’t bend it to our will. A quick look at Shopify’s documentation shows an easy way to add extra fields and settings to the editor bar on the right – and we can add a text field to insert our own class! Since I like putting my sections into groups, a class on the Group block would be perfect here.
The text field for a class name in the top right panel was added by me!
Visiting the group.liquid block, you can see a schema of all the settings – I literally just copied and pasted here from an existing setting, changing the type to text and giving it an id of “class”. In the render script above, I added a class attribute and called to the next field by using it’s id:
{%- capture children %}
{% content_for 'blocks' %}
{% endcapture %}
{% render 'group', children: children, settings: block.settings, shopify_attributes: block.shopify_attributes, class: block.settings.class %}
{% schema %}
{
"name": "t:names.group",
"tag": null,
"blocks": [
{
"type": "@theme"
},
{
"type": "@app"
},
{
"type": "_divider"
}
],
"settings": [
{
"type": "text",
"id": "class",
"label": "Class"
}
.......
}
{% endschema %}
This of course then allows you to customize to your heart’s content in base.css. Without affecting every single group on the site. Which would be disastrous.
Custom Sections
Of course no theme will have all of the sections your client is going to want. For this site, we wanted both a cute image gallery and a testimonials section on the homepage. I needed to make sure whatever content was going here was going to be easy for the client to update often. These was surprisingly easy to do, thanks to the wide support of various modules in the Dwell theme.
Four image blocks in a group, a text block, all CSS!
For the little image gallery section, I just literally dropped in four image blocks and a text block, and styled the little grid effect (with CSS columns for the offset look!) in base.css.
The testimonial section was a little bit more complicated because we wanted alternating left/right rows of testimonials that needed different styling (hence the custom class field above!) I wanted to make sure the client wouldn’t get confused on how to achieve this effect when adding more, so I grouped each testimonial as “Testimonial” or “Testimonial – Reverse” so they could easily be duplicated in future. Again, this was using only premade blocks with custom CSS.
Alternating group blocks make it easy for the client to know which to duplicate when it comes time to add more.
In Closing
This option is great for small businesses who need something simple to get up and running, and doing smaller jobs like this will actually slowly teach you how to fully grasp Shopify’s liquid language. This was exactly the way I learned WordPress almost 20 years ago!
Shopify theming isn’t the most exciting job in the world, but it’s an easy way to increase your revenue and open your services up for a wider audience. It’s easy to learn, especially if you’re already used to handlebar syntax in HTML (like with CraftCMS). In this day and age where our industry is getting hit hard by AI junk, expanding your toolbelt helps ensure your future job prospects!