Change styles and fonts from re used modules on sections

Hello friends! I we are re using modules that we call on sesions, we haven’t figure out how to change the styles, fonts and other css features on the sections, on what tag can we do it and how?, columns, rows, sections? thank you so much for answering…

Hi @HorusChild,

Thank you for reaching out!

Are you referring to CMS modules and how to change the styling for said modules? Could you include some screenshots of what you’re trying to achieve? The more information you can include, the better the Community can assist with next steps.

Thank you!

Best,

Kristen

I’m working from a section, calling an existing module which I want to change text style, font size, and the blue line, since the module should have it but in the current section I’m building I will need to dismiss it, this is my first approach to hubspot and I’ve been searching about it in the documentation but haven’t found the solution, thank you people for helping!

Hi @HorusChild,

Thank you for including these additional details and screenshots! That’s very helpful :slightly_smiling_face:

I would like to add our subject matter experts to see if they have advice.

Hi @Anton, @Teun, @LMeert - Do you have any insight for @HorusChild?

Thank you!

Best,

Kristen

Hi @HorusChild,

if you want to add/modify modules you have several approaches:

  • modify/extending the module functionality (almost endless customizability per module)
  • creating/adding configuration modules
  • creating/adding configurations to template

My personal way-to-go is always modifying the module since it’s much easier and will give you a great flexibility.

How to modify a module?

If it’s a module from a marketplace theme and you can’t edit it because you see the “You can’t edit the module unless you duplicate/clone it” info bar → duplicate the module and give it a name like “Headline text NEW” or something you will now the difference between those two modules.

After you’ve duplicated and renamed it, it should be already open. Now it’s completly up to you. You can modify everything you like.

Some best-practises:

- adding automatically generated CSS classes. Great if you want to use the module several times on a single page and modify each one individually can be achieved with the build-in-hubl “{{ name }}”.

<div class="myModule {{ name }}">
...
</div>

important note:

If you want individual styling per module add the CSS in HTML+Hubl field of the module (unless you trigger CSS classes)

{% require_css %}{# this will add a style-tag per module instance to your head-tag #}
<style>
.myModule.{{ name }}{
}
</style>
{% end_require_css %}

<div class="myModule {{ name }}">
...
</div>

- To trigger predefined classes you can add a choice field and put the classes as values

<div class="myModule {{ module.predefined_class }}">
...
</div>

- adding an option for a custom class can be achieved with a simple text element(not rich-text). For this example I call it “Custom class”

<div class="myModule {{ module.custom_class }}">
...
</div>

In your case you have to figure out how the blue line comes into play - if it’s a CSS class you can wrap it inside a boolean/if-statement like this (for example I’m calling mine “Toggle blue line”)

<div class="myModule {% if module.toggle_blue_line %}cssClassReponsibleForTheBlueLine{% endif %}">
...
</div>

hope this helps,

best,

Anton

Thank you so much for your answer Anton, it was very helpful!