Branch solution up to 1.10.3
AFAIK, in the branch there is no such filter.However, you can use the operator inas follows:
{% spaceless %}
{% set test_class = ' ' ~ class ~ ' ' %}
{% if ' icon-white ' in test_class %}
{% endif %}
{% endspaceless %}
So, for example, if your class looks like 'some-class icon-white icon-white-2', then test_class will take a value ' some-class icon-white icon-white-2 'and inreturn truefor that class. He, however, will return falsefor ' some-class icon-white-2 ', as expected.
source
share