Greetings.
I am porting an older forum onto discourse and the original site had a unique theme (including unique header logo) for one of their categories.
My current solution is a theme-component that looks something like this:
CSS:
body.category-target-category{
///replace the #hexcodes with the color values of your choice
--primary: #primaryhexcode;
--secondary: #secondaryhexcode;
--tertiary: #tertiaryhexcode;
///continue for any/all required color values
}
HTML/JS:
<script type="text/discourse-plugin" version="0.2.0">
api.onPageChange(() =>{
var logo = document.getElementById("site-logo");
var categories = document.getElementsByClassName("category-target-category");
if(categories.length > 0)
{
logo.src = "category-specific-logo-url";
}
else
{
logo.src = "standard-logo-url";
}
});
</script>
Currently, I have to iterate through every possible color value mentioned in color_definitions.scss in order to override them. I believe that the values for this file are produced foundation/color_transformations.scss, which generates them from the values found in foundation/colors.scss. I know that you can override the root color theme values either via the admin menu or in the about.json of the theme-component, but I believe these changes take place site-wide.
Is there a more efficient way to customize a specific category aside from listing out all of the 100+ variables in color_definitions.scss? For instance can the foundation/colors.scss file be modified via a theme-component?
Thanks for your help!