Skip to content

Instantly share code, notes, and snippets.

@glinesbdev
Last active August 29, 2015 14:08
Show Gist options
  • Save glinesbdev/50c2b2f422ad8d9d5f2c to your computer and use it in GitHub Desktop.
Save glinesbdev/50c2b2f422ad8d9d5f2c to your computer and use it in GitHub Desktop.
Theme File Breakout
I did some research on and figured out how we can drastically reduce the amount
of customizations we deal with for each portal. I checked Shopify’s file structure
and figured out how they do it.
This email is going to describe how I think the assets and the code
belonging to said assets on the portal, specifically CSS and JavaScript,
should be handled on our platforms. I will describe how it is being used
today and how we should be using it.
How are we using CSS and JavaScript right now?
For all of our customer cusomtizations we are creating / editing the CSS
styles and JavaScript functions in the same file as the HTML code that
is the underlying structure of each page. When you customize a file in
this way, the portal sees the file as "custom" therefore that file will
no longer get any macro push updates that we would like all of our
customers to have (namely functionality) that could break an entire site
for one reason or another.
How should we be using CSS and JavaScript moving forward?
Right now, each platform has an "application.css" file which is the main
CSS file for the site. It controls all of the styles of the site. We
also have an "application.js" that controls all of the JavaScript on the
site. I am proposing that we DO NOT make any changes to these files as
well as no longer putting custom CSS and JavaScript for our customers in
the HTML (Liquid) files. To add another layer to this, we can hide the
"application.css" and "application.js" files from our customers when
they are modifying their site and have only super admin access to those
files (which we really shouldn't need unless adding major changes to the
platform as a whole in regards to it's CSS or JavaScript).
We should create two additional files: "custom.css" and "custom.js" in which we
keep ALL of ANY customer's custom CSS and JavaScript changes /
additions. This will effectively allow us to push macro code changes to
all portals without running into the "can't push to this cusotmer
because one of their files is has custom changes" problem.
Any input or feedback on the issue is greatly appreciated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment