My team and I are starting to build a large website using ClojureScript + Reagent. We’re using both client-side bundles, as well as server-side rendering.
The project itself actually encompasses 3 different brands, which are determined by the URL they access the page from (and member info once they login). The 3 brands are mostly separated by colors & logos, but overall look & feel is the same.
We’ve started down the path of building components out styles & components that are “brand agnostic” and I’m wondering the best way to go about this that won’t be an unmanageable mess.
Potential solutions I’m pondering.
Right now, we’re addressing it by passing the brand in to each component
Another way I’ve seen this done in the React world was using the Context API to pass things down.
My current too-clever scheme is to use
with-redefs before rendering the app to redefine the style(s).
Any thoughts from the community? I’m leaning towards the 3rd one only because it’s so easy, but I have a small feeling that the amount of non-local reasoning it would introduce is going to come back and bite me much later.