Hi,
you can write a sling filter if wants to just add additional class to a component(e.g. container) based on condition
Example -
https://github.com/arunpatidar02/aemaacs-aemlab/blob/master/core/src/main/java/com/community/aemlab/oneweb/core/filters/CacXfFilter.java
here is the simplified versi...