The discussion revolves around global theme settings in Discourse. Vaping_Community asks about applying global CSS and HTML settings across multiple themes. ZackFea explains that Theme Components can be used for this purpose, allowing shared elements like CSS and HTML to be included in multiple themes. ZackFea provides an example: creating a component theme (e.g., mySpecialHeader) with shared code, then including it in specific themes (e.g., dark and light). This approach also supports Sass variables with !default flags, enabling theme-specific overrides. Vaping_Community appreciates the explanation and the link to a guide on core variables here.
I love the ability to theme discourse and it works really well for individual themes but I feel like global settings for /head / CSS etc that would apply to all themes would make things so much easier when trying to manage multiple themes.
That is what the Theme Components are for. Add a general theme as compoment to your specific themes and do the general things inside the component. You can use this to override parts of existing themes as well.
Ok let me say you got a dark and a light theme and you want to add a custom html header and little bit css to both.
So you create a new theme, name it as you want, i will call it mySpecialHeader. Add your custom html and css to this.
Now edit your dark theme, check the “Theme include other child themes”. See screenshot below.