<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: referencing theme colors in module CSS in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/referencing-theme-colors-in-module-CSS/m-p/1259752#M45224</link>
    <description>&lt;P&gt;Haven't tried it in quite some time as I got a whole different approach, but it should be possible, yes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unless you create a different approach yourself, you need to use the same "dot-path"&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Advanced tip:&lt;BR /&gt;You can create HubL objects (not a very documented approach) like&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% set module_styles = {
 "bg_color" : theme.group_1.group_2.group_3.bg_color.css,
 "text_color" : theme.group_1.group_2.group_3.text_color.css}
%}

&lt;/LI-CODE&gt;
&lt;P&gt;at the top (recommended) of a module&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and then use it like&lt;/P&gt;
&lt;LI-CODE lang="css"&gt;.myDiv{
   background-color: {{ module_styles.bg_color }};
   color: {{ module_styles.text_color }};
}&lt;/LI-CODE&gt;
&lt;P&gt;but make sure that it won't share the same labels/names as something else in the module as it will colide.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the proven/easy-to-use approach is to put all global theme settings into one dedicated file like &lt;STRONG&gt;theme-overrides.css&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anton&lt;/P&gt;</description>
    <pubDate>Tue, 17 Mar 2026 21:25:45 GMT</pubDate>
    <dc:creator>Anton</dc:creator>
    <dc:date>2026-03-17T21:25:45Z</dc:date>
    <item>
      <title>referencing theme colors in module CSS</title>
      <link>https://community.hubspot.com/t5/CMS-Development/referencing-theme-colors-in-module-CSS/m-p/1259702#M45219</link>
      <description>&lt;P&gt;I am attempting to build a module that will use the theme's "Base Color 2" in the module's css file.&amp;nbsp; 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.&amp;nbsp; i have tried several iterations of "theme.group.group_colors.group_base_colors.color_2.color" all make the upload barf with&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[ERROR] HubSpotHttpError: The post in account 51183775 was bad. internal error&lt;BR /&gt;- group.group_colors.group_base_colors.color_2.color is not a valid path to a default property&lt;BR /&gt;- theme.group.roup_colors.group_base_colors.opacity is not a valid path to a property&lt;BR /&gt;- theme.group.group_colors.group_base_colors.color is not a valid path to a property&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is the field in my module's fields.json&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "id" : "ab6d16db-f107-9a01-fd66-575c2c69beef",
  "name": "background_color",
  "type": "color",
  "label": "Background Color",
  "inherited_value": {
    "default_value_path": "theme.group.group_colors.group_base_colors.color_2.color",
    "property_value_paths": {
      "color": "theme.group.group_colors.group_base_colors.color",
      "opacity": "theme.group.roup_colors.group_base_colors.opacity"
    }
  }
}&lt;/LI-CODE&gt;&lt;P&gt;where in the documentation are the rules for this syntax described?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 19:14:14 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/referencing-theme-colors-in-module-CSS/m-p/1259702#M45219</guid>
      <dc:creator>isiwebdev</dc:creator>
      <dc:date>2026-03-17T19:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: referencing theme colors in module CSS</title>
      <link>https://community.hubspot.com/t5/CMS-Development/referencing-theme-colors-in-module-CSS/m-p/1259707#M45220</link>
      <description>&lt;P&gt;Hey &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/1053741"&gt;@isiwebdev&lt;/a&gt;&lt;/SPAN&gt;,&lt;BR /&gt;&lt;BR /&gt;Thanks for posting in the Community!&lt;BR /&gt;&lt;BR /&gt;I'd like to tag in some Community experts to see what insight they may have on the rules for this syntax! &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/17186"&gt;@Anton&lt;/a&gt;, &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/114957"&gt;@Syeda_Fatima&lt;/a&gt;&lt;/SPAN&gt;, and &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/313109"&gt;@HFisher7&lt;/a&gt;&lt;/SPAN&gt; - any thoughts here?&lt;BR /&gt;&lt;BR /&gt;Shane, Senior Community Moderator&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 19:12:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/referencing-theme-colors-in-module-CSS/m-p/1259707#M45220</guid>
      <dc:creator>STierney</dc:creator>
      <dc:date>2026-03-17T19:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: referencing theme colors in module CSS</title>
      <link>https://community.hubspot.com/t5/CMS-Development/referencing-theme-colors-in-module-CSS/m-p/1259710#M45221</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/1053741"&gt;@isiwebdev&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;modules unfortunately can't inherit theme settings by default.&amp;nbsp;&lt;BR /&gt;Think of themes and modules like self contained containers. A theme can technically contain 0 modules and a module doesn't require a theme.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want global inheritace, you can use instead is the &lt;A href="https://developers.hubspot.com/docs/cms/start-building/building-blocks/fields/brand-and-settings-inheritance#brand-settings-inheritance" target="_blank" rel="noopener"&gt;brand kit inheritance&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anton&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 19:32:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/referencing-theme-colors-in-module-CSS/m-p/1259710#M45221</guid>
      <dc:creator>Anton</dc:creator>
      <dc:date>2026-03-17T19:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: referencing theme colors in module CSS</title>
      <link>https://community.hubspot.com/t5/CMS-Development/referencing-theme-colors-in-module-CSS/m-p/1259715#M45222</link>
      <description>&lt;P&gt;am i able to directly reference a theme's colors in the module's css?&amp;nbsp; it seems really clunky to have to copy/paste theme colors into each and every module instance that would appear on a website.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;would i use that same dot-path to use the theme's color in the css template?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
background-color: {{ theme.group.group_colors.group_base_colors.color_2.color }};
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 19:51:49 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/referencing-theme-colors-in-module-CSS/m-p/1259715#M45222</guid>
      <dc:creator>isiwebdev</dc:creator>
      <dc:date>2026-03-17T19:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: referencing theme colors in module CSS</title>
      <link>https://community.hubspot.com/t5/CMS-Development/referencing-theme-colors-in-module-CSS/m-p/1259752#M45224</link>
      <description>&lt;P&gt;Haven't tried it in quite some time as I got a whole different approach, but it should be possible, yes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unless you create a different approach yourself, you need to use the same "dot-path"&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Advanced tip:&lt;BR /&gt;You can create HubL objects (not a very documented approach) like&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% set module_styles = {
 "bg_color" : theme.group_1.group_2.group_3.bg_color.css,
 "text_color" : theme.group_1.group_2.group_3.text_color.css}
%}

&lt;/LI-CODE&gt;
&lt;P&gt;at the top (recommended) of a module&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and then use it like&lt;/P&gt;
&lt;LI-CODE lang="css"&gt;.myDiv{
   background-color: {{ module_styles.bg_color }};
   color: {{ module_styles.text_color }};
}&lt;/LI-CODE&gt;
&lt;P&gt;but make sure that it won't share the same labels/names as something else in the module as it will colide.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the proven/easy-to-use approach is to put all global theme settings into one dedicated file like &lt;STRONG&gt;theme-overrides.css&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anton&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 21:25:45 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/referencing-theme-colors-in-module-CSS/m-p/1259752#M45224</guid>
      <dc:creator>Anton</dc:creator>
      <dc:date>2026-03-17T21:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: referencing theme colors in module CSS</title>
      <link>https://community.hubspot.com/t5/CMS-Development/referencing-theme-colors-in-module-CSS/m-p/1259771#M45225</link>
      <description>&lt;P&gt;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.&amp;nbsp; 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.&amp;nbsp; I had asked the doc AI some questions about it but every single suggestion it had was wrong.&amp;nbsp; is there documentation as to what is accessible in the CSS files?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there are some examples at&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/cms/reference/modules/files" target="_blank"&gt;https://developers.hubspot.com/docs/cms/reference/modules/files&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;is this the total list of what hubl is available in css files?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 22:45:21 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/referencing-theme-colors-in-module-CSS/m-p/1259771#M45225</guid>
      <dc:creator>isiwebdev</dc:creator>
      <dc:date>2026-03-17T22:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: referencing theme colors in module CSS</title>
      <link>https://community.hubspot.com/t5/CMS-Development/referencing-theme-colors-in-module-CSS/m-p/1259861#M45228</link>
      <description>&lt;P&gt;Yes,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HubL works only inside the module.html, but not module.css or module.js.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;However HubL works in "regular" CSS files outside of modules.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;example structure of files:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;theme
&lt;UL&gt;
&lt;LI&gt;CSS (folder)&lt;BR /&gt;
&lt;UL&gt;
&lt;LI&gt;some_css.css (HubL works here)&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;modules (folder)&lt;BR /&gt;
&lt;UL&gt;
&lt;LI&gt;button (module)
&lt;UL&gt;
&lt;LI&gt;module.html (HubL works)&lt;/LI&gt;
&lt;LI&gt;module.css (HubL doesn't work)&lt;/LI&gt;
&lt;LI&gt;module.js (HubL doesn't work)&lt;/LI&gt;
&lt;LI&gt;meta.json (HubL doesn't work; &lt;EM&gt;only accessible via local dev&lt;/EM&gt;)&lt;/LI&gt;
&lt;LI&gt;fields.json (HubL doesn't work; &lt;EM&gt;only accessible via local dev&lt;/EM&gt;)&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;templates (folder)
&lt;UL&gt;
&lt;LI&gt;some_html.html (HubL works)&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;js (folder)
&lt;UL&gt;
&lt;LI&gt;some_js.js (HubL works)&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;theme.json (HubL doesn't work)&lt;/LI&gt;
&lt;LI&gt;fields.json (HubL doesn't work)&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;edit:&lt;/P&gt;
&lt;P&gt;If you use {% set %}, it will work only in the module.html&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best,&amp;nbsp;&lt;BR /&gt;Anton&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2026 07:53:13 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/referencing-theme-colors-in-module-CSS/m-p/1259861#M45228</guid>
      <dc:creator>Anton</dc:creator>
      <dc:date>2026-03-18T07:53:13Z</dc:date>
    </item>
  </channel>
</rss>

