CMS Development

Sasha-A8
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;

 

SashaA8_0-1716575399895.png

 

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 svsosin@revpartners.io


WebOps Technologist | HubSpot CMS Developer, Designer

RevPartners

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


Get a customized HubSpot plan


0 Upvotes
1 Reply 1
BérangèreL
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!

Best,
Bérangère


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!


0 Upvotes