CMS Development

Contributor | Elite Partner
Contributor | Elite Partner

[BUG] CSS Minification blocked by CSS variables (--*)

CSS files are minified automatically in HS CMS unless they contain syntax errors.


Putting my code through a linter shows that my css variables are the problem.


Such as --clr-primary: green;




This seems to be an issue with outdated nature of CodeMirror that rejects css variables as valid strings.


Variables are a modern CSS feature that work across most browsers, so it seems like this should be fixed or an override could be implemented.

Did this answer your question? Help the community by marking this response as a solution.

Sasha Sosin

WebOps Technologist | HubSpot CMS Developer, Designer


Ready to level up your business? Let's chat.

Get a customized HubSpot plan

1 Reply 1
Community Manager
Community Manager

[BUG] CSS Minification blocked by CSS variables (--*)

Hi @Sasha-A8,

Thank you for reaching out to the Community!

Thank you also for sharing this! I will pass it along internally for more visibility.

I'd like to share these similar threads that might help you:

- Variables not applying to other attached CSS
- Using theme variables in template hubl code not working for padding
- Stylesheets Not Compiling Properly

In the meantime, I'd be happy to put you in touch with some of our Top Experts and other Community Members: Hi @cwilbanks, @Jsum, @JohnLaprairie, @alyssamwilie, @dsmarion, @JMellish do you experience the same? If yes, do you have workarounds to share with @Sasha-A8, please?

Thank you very much and have a great day!


Saviez-vous que la Communauté est disponible en Français ?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres !

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings!