In this post we will discuss how you can use doT.js, a fast and lightweight template engine, to re-render window styling on the fly. We recently used doT.js in a custom theme editor we built for one of our apps. We used doT.js in two ways:
1. We were able to store predefined color themes as JSON objects on the server which could then be converted into CSS on the client side and applied to all windows.
2. We were able to change the color of a specific element in real time as a user dragged their mouse over a color palette. In this post we will go through how to complete part 1 and in a later post we will explain how to complete part 2.