CMS Development

cwilbanks
Member

Variables not applying to other attached CSS

SOLVE

I have some variables and macros defined in a base CSS file that is attached to a template. When I attach another CSS file to the template, say Modules.css, the variables do apply to the Module.css classes and ids. Does anyone have a clue why this isn't working and what I need to do to fix it?

 

Thanks in advance!

0 Upvotes
1 Accepted solution
Jsum
Solution
Key Advisor

Variables not applying to other attached CSS

SOLVE

macros are server code, each page is processed individually by the server then sent to the user end. Your macros are probably being processed before the other stylesheet is recognized. Consider creating a separate macros sheet and importing it into the stylesheets that you will be calling the macros.

 

You will find examples of this in the HubL docs: https://designers.hubspot.com/docs/hubl/hubl-variables-and-macros-syntax

View solution in original post

0 Upvotes
1 Reply 1
Jsum
Solution
Key Advisor

Variables not applying to other attached CSS

SOLVE

macros are server code, each page is processed individually by the server then sent to the user end. Your macros are probably being processed before the other stylesheet is recognized. Consider creating a separate macros sheet and importing it into the stylesheets that you will be calling the macros.

 

You will find examples of this in the HubL docs: https://designers.hubspot.com/docs/hubl/hubl-variables-and-macros-syntax

0 Upvotes