In the discussion titled “Best Workflow for Maintaining Themes?” under the Dev category, TheDarkWizard seeks advice on how to best maintain customizations to an existing theme — specifically @rewphus’s Material Design Stock Theme. They consider forking the theme and syncing from upstream, but awesomerobot suggests a simpler approach: using a theme component as a child of the base theme. This allows custom edits to remain separate, enabling easy updates to the parent theme without losing modifications. TheDarkWizard expresses enthusiasm for Git-based workflows and questions whether theme components are meant for small-scale edits and if they can modify Color Schemes. awesomerobot clarifies that components can handle extensive overrides (though copying the entire theme is discouraged) and that while components can’t directly edit Color Schemes, users can create and apply new schemes via the theme’s settings. DBHacker offers a practical workflow: fork, clone, edit in VS Code, push to GitHub, install, and test — though awesomerobot cautions that forking may isolate users from upstream fixes if the original theme is actively maintained. The consensus leans toward using theme components for maintainability, with forking reserved for cases requiring deeper, independent control.
I wanted to ask what the recommended or best method of maintaining your edits/customizations on say an existing theme is?
I’d like as an example to make edits to @rewphus’s fantastic Material Design Stock Theme and I was wondering if it would be good to fork it, build on it and then try to sync from upstream?
I know in other forum software that doesn’t use Repos or Git concepts, you would be to install a copy of the theme and then install second copy as a child and only edit the child, so that when updates came in, you’d update the parent.
You can essentially do the same thing: build your own theme component and add that as a child to your base theme (sourced from git). Then you can update the git theme as needed without impacting your custom work in the component.
That’s the simplest way, you might be duplicating some CSS but probably not an unmanageable amount.
I had read that and have completely fallen in love with the process. I’ll admit that until this year, I never really used Git to organize my work but I’m loving the workflow.
I had thought about using a theme component, but I had thought that it was supposed to be smaller-scale stuff on a conceptual level. Can a theme component edit the Color Scheme in any way? That feature seems exclusive to themes.
I will re-read that document again since it was late when I read it yesterday and begin to do this instead as a theme component :).
There’s no requirement that it is. I wouldn’t recommend copying the entire base theme and putting that in a component… that’s carrying around way more CSS than you’d need, but you can add as many overrides as you want.
Not directly, but you can create a new Color Scheme and select that as an option from the base theme’s settings. Any color scheme can be applied to any theme (how effective this is can vary based on how the theme was built).
This workflow is fine, but it might not always make sense to jump straight to a fork… especially if the original theme appears to be well-maintained. When you fork you’re more on your own if an underlying Discourse update breaks your theme.