CMS Development

Jsum
Key Advisor

Maybe a Settings variable bug?

Hello all,

I plugged my framework into a new portal and then changed the portal's email/branding colors but the variables seem to be frozen to the original settings.

{% set primary_color        = site_settings.primary_accent_color %}
{% set primary_color_rgb    =  primary_color|convert_rgb|split(',') %}
{% set secondary_color      = site_settings.secondary_accent_color %}
{% set background_color     = site_settings.background_color %}
{% set body_color           = site_settings.body_color %}
{% set body_border_color    = site_settings.body_border_color %}
{% set primary_font_color   = site_settings.primary_font_color %}
{% set secondary_font_color = site_settings.secondary_font_color %}

{% set favorite_color_1     = site_settings.colorPickerFavorite1 %}
{% set favorite_color_2     = site_settings.colorPickerFavorite2 %}
{% set favorite_color_3     = site_settings.colorPickerFavorite3 %}
{% set favorite_color_4     = site_settings.colorPickerFavorite4 %}
{% set favorite_color_5     = site_settings.colorPickerFavorite5 %}
{% set favorite_color_6     = site_settings.colorPickerFavorite6 %}

I'm just short-handing the settings variables here. 

I'm using these variables in a ton of button class controls. I'm having to go through and swap my proxy for the long hand of the variable, my shorthand is storing the original hex values.

/* button outlined color controls */
.ry [class*="ry" i][class*="btnprimary" i][class*="outlined" i] {background:transparent; color: {{primary_color}}; border: 1px solid {{primary_color}};}
.ry [class*="ry" i][class*="btnsecondary" i][class*="outlined" i] {background:transparent; color: {{site_settings.secondary_accent_color}}; border: 1px solid {{site_settings.secondary_accent_color}};}
.ry [class*="ry" i][class*="btnbody" i][class*="outlined" i]  {background:transparent; color: {{body_color}}; border: 1px solid {{body_color}};}
.ry [class*="ry" i][class*="btnbackground" i][class*="outlined" i]  {background:transparent; color: {{background_color}}; border: 1px solid {{background_color}};}
.ry [class*="ry" i][class*="btnsuccess" i][class*="outlined" i]  {background:transparent; color: {{favorite_color_1}}; border: 1px solid {{favorite_color_1}};}
.ry [class*="ry" i][class*="btndanger" i][class*="outlined" i]  {background:transparent; color: {{favorite_color_2}}; border: 1px solid {{favorite_color_2}};}
.ry [class*="ry" i][class*="btnwarning" i][class*="outlined" i] {background:transparent; color: {{favorite_color_3}}; border: 1px solid {{favorite_color_3}};}
.ry [class*="ry" i][class*="btninfo" i][class*="outlined" i] {background:transparent; color: {{favorite_color_4}}; border: 1px solid {{favorite_color_4}};}

I haven't had this problem before. I have set this version of my framework up in a handful of portals, so far, and usually, the colors just work. For some reason, this portal doesn't like my variables. I changed the color settings a day or so ago so I don't think its a caching thing. 

0 Upvotes
3 Replies 3
dennisedson
HubSpot Product Team
HubSpot Product Team

Maybe a Settings variable bug?

@Jsum 

A: are you still working on this?

If A is yes, I am sure you have checked, but just to make sure, there is not another css rule somewhere that is trumping yours in the head, inlined etc.  Can you share a link?

If A is no, Glad you figured it out

@piersg , do you have any additional thoughts?

0 Upvotes
Jsum
Key Advisor

Maybe a Settings variable bug?

Hi @dennisedson , No, the issue is that when I use my shorthand variables they output the old hex color codes from the settings, while I have updated those colors. If I use the raw HubL tokens it gives me the updated hex codes, so for some reason, the CSS document is remembering the old values on variables set inside of it. It's still an issue but I've deleted all of my variables and moved on. I'm just going to have to rewrite my framework sometime to use those tokens directly.

dennisedson
HubSpot Product Team
HubSpot Product Team

Maybe a Settings variable bug?

Sorry that you have to rework it 😥.  Hopefully, you will have a more powerful product afterwards (my midwestern attempt at optimism)

0 Upvotes