I have three pages: Dashboard, User, and Nutrition. Each of these pages will support three different themes: Minimal, Maximal, and Medium. The data displayed on each page will stay the same, but the HTML structure and CSS styling of the page will change depending on the selected theme.
While the HTML of components on each page, such as the Dashboard, will remain consistent across themes, only the CSS will vary based on the chosen theme.
To implement this, I plan to use an event emitter that notifies subscribed components of when the theme changes. Additionally, I’ll create a wrapper component for each group of related pages (e.g., one for the Dashboard, another for the User page, and one for the Nutrition page) - I believe this is known as the bridge pattern. This wrapper is purely responsible for listening to the emitter and modifying its internal view whenever the theme changes.
Since this causes a rebuild of the inner view, I was wondering if it was possible to just pass down the chosen theme to components used within the newly rendered page and then selecting a specific style sheet based off that theme or if i needed to also make the components subscribers of my theme event emitter.
Any recommendations or suggestions would be greatly appreciated. Still new to all this so if I've overcomplicated things then please let me know.