theme-scripts icon indicating copy to clipboard operation
theme-scripts copied to clipboard

Promote the use of custom.js for theme customizations

Open t-kelly opened this issue 6 years ago • 0 comments

One of the biggest problems we have with updating an existing implementation of a theme is that the theme's source code often is modified. Once these edits have been made, it makes it pretty hard to apply updates - especially to a large number of stores. The edits can be made directly to the theme's JS files, or they live as inline scripts scattered throughout the DOM (not good).

custom.js is a file where you can perform theme modification without the need to edit Theme source code or inline JS inside liquid files. When combined with the new version of section.js, you can customize and extend any existing JS in the theme without the need to touch source code.

custom.js itself is very simple, just a empty JS file with maybe some comments. The power of it lies in documentation and examples.

Copy of https://github.com/Shopify/slate/issues/265

t-kelly avatar Feb 21 '18 16:02 t-kelly