I am attempting to build a module that will use the theme’s “Base Color 2” in the module’s css file. i cannot find anywhere in documentation that talks about the rules for syntax in the module’s fields.json to set the default color to the theme’s “Base Color 2”. i am using the elevate theme. i have tried several iterations of “theme.group.group_colors.group_base_colors.color_2.color” all make the upload barf with
[ERROR] HubSpotHttpError: The post in account 51183775 was bad. internal error
- group.group_colors.group_base_colors.color_2.color is not a valid path to a default property
- theme.group.roup_colors.group_base_colors.opacity is not a valid path to a property
- theme.group.group_colors.group_base_colors.color is not a valid path to a property
Hey @isiwebdev,
Thanks for posting in the Community!
I’d like to tag in some Community experts to see what insight they may have on the rules for this syntax! @Anton, @Syeda_Fatima, and @HFisher7 - any thoughts here?
Shane, Senior Community Moderator
modules unfortunately can’t inherit theme settings by default.
Think of themes and modules like self contained containers. A theme can technically contain 0 modules and a module doesn’t require a theme.
am i able to directly reference a theme’s colors in the module’s css? it seems really clunky to have to copy/paste theme colors into each and every module instance that would appear on a website.
would i use that same dot-path to use the theme’s color in the css template?
but make sure that it won’t share the same labels/names as something else in the module as it will colide.
But the proven/easy-to-use approach is to put all global theme settings into one dedicated file like theme-overrides.css
There are many other different undocumented approaches and you can try things out, but if you want to get started quickly, I’d stick to the theme-overrides/boilerplate approach
it appears that if i use the {% set … %} in the module.html i can use it in the module.html. it looks like i cannot, however, reference any of them in the module’s css file. from what i had read in docs; you can use the jinja style code in the css files but it was unclear as to what, exactly, is accessible in the CSS files. I had asked the doc AI some questions about it but every single suggestion it had was wrong. is there documentation as to what is accessible in the CSS files?