Theming Is Common SaaS clients want to offer a varied product range. White-label clients want to offer bespoke themes. Hub clients want each part of a product to have its own colours. Social network clients want to allow users to personalise things.
Advice on Theming Avoid it if possible—make sure there’s a real business case. KISS—always reduce the complexity involved. Only make changes to cosmetic aspects—avoid altering box-model. Enforce rules—deviation is expensive. Use it as an up-sell—‘Any deviation is going to cost you.’
Theme Layer Possibly the most common approach (currently). Start off with the base/default styling. Use additional, subsequent CSS to override and redefine.
The Bad Lots of logic in your Sass. Only supports a finite number of themes. Theme information is spread out through the codebase. Adding themes could be laborious.
User Customisation Drop the hex value(s) into a style block. Bind onto utility classes rather than existing hooks. Now just a case of decorating in the UI with the classes.
When to Use Which? Who’s doing the styling: you or the user? – User Customisation. Do the themes need to change once they’re on the client? – Stateful or User Customisation. Do you have themes that you want people to be able to toggle? – Stateful. Do you have sections of the site that need to look different? – Stateful. Do you have preset themes that a client can choose from? – Config. Do you offer bespoke theming for white-label clients? – Theme Layer or Theme Palette.