Great question — answering as the UphillTech team:
You can use something like this: Replace <body> in theme.liquid with the below one: <body class="{{ template }} {{ page.handle }}{% if template == 'collection' %}{{ collection.handle }}{% endif %}{% if template == 'product' %}{{ product.title | handleize }}{% endif %}{% if template == 'blog' %}{{ blog.handle }}{% endif %}{% if template == 'article' %}{{ article.title | handleize }}{% endif %}"> To add a class to the body element of the page. To break it down, here is what I'm doing: {{ template }} this return the name of the template ( for example index for the home page, blog for the blog page, collection for the shop page an so on ) {{ page.handle }} returns the handle of each unique page...
Full answer by drip: https://stackoverflow.stackexchange.com/a/36513849 (CC BY-SA 3.0).
Need it done for your business? UphillTech.