How to override CSS classes with Hugo

This is an ancient topic and a lot of things have changed in Hugo since 2018.

Please have a look at the forum guidelines.

If your question is about specifying CSS conditionally you would either need to use Conditional Logic in a page template or selectively load the CSS file as a resource and use ExecuteAsTemplate.

If you are looking into loading the CSS conditionally from within a shortcode then this question already has an answer over here: Use conditional for css style with shortcode

I am archiving this topic because as I said above things have changed and also people who participated in this discussion may not be around in this forum currently.

If you are still unable to solve your issue then please open a new topic, while following the Requesting Help tips.