We’re having trouble with the default block field used to add additional CSS. The field can be found in Block Settings > Advanced > Additional CSS Classes. We’ve used this to add a CSS class to our forms to support dark mode. This worked great before, but now the classes are not being applied to newly created HubSpot blocks.
Hi @viktorbijlenga Thanks for your message For styles to be applied to a HubSpot Form they need to be configured as Raw HTML forms inside Hubspot. Otherwise any classes will not get added due to CSP Cross–Site Scripting policy.
Can you confirm if the Form you are trying to apply styles to is a Raw HTML form?
Yes! We are using the Raw HTML form variant. Our issue is not related to that, since the RAW HTML works just as intended.
The HubSpot Form block has stopped adding the custom CSS classes to the block itself. As a result, the output no longer includes the additional CSS classes, which disrupts our system for applying different form styles as needed.
These classes used to be added to the wrapper div of the block, which is not the case anymore. Can this be fixed?
Here is a breakdown of the code differences, in images if it makes things more clear.
Previously the block output allowed this to be created:
These blocks seems to be corrupt these days as well, when we try to edit a page. Form blocks without the additional css-class, works just fine.
If we create a new HubSpot Form block, the output doesn’t include the additional CSS-class for dark-mode.
Let me know if there is anything else I can provide, to be able to debug.