Scenario
An agency has one website with one domain but there is the need to display themed sub-sections of the website. ie. The site needs to deliver content to different channels.
Challenge
There are UX and content design challenges to this requirement. However, here we will focus on the presentation of styling requirements. How can we deliver different styling depending on which channel the content belongs in. GovCMS doesn’t ship with any theme switcher modules which can select the theme based on certain criteria. A solution needs to be found in the theme layer.
Solution
The foundation of the solution is naturally based on the channel the content belongs to This can be determined by the path or perhaps a taxonomy that has been applied to the channel. Once this has been determined the styles can be customised. From here there are a couple of approaches. This could be done by a selector or through the injection of custom styles to the header. Another approach would be to define a separate set of CSS variables that are loaded into the page. These can then define how the page is styled. The general gist is that some custom work needs to be done in the theme level to make this happen.
Outcome
The use of modern approaches such as CSS Variables brings flexibility to the presentation of the site. It is now relatively easy to control the overall look and feel of the site without the need to switch the actual theme using a module.