{% autoescape false %} {% set css_name = '.' ~ item.class_name %} {% set properties = item.properties|json_decode %} {% set link = '' %} {% if item.link %} {% set link = item.link|json_decode %} {% endif %} {% if (item.is_responsive and item.is_responsive == 1) %} {% set devices = ['desktop', 'tablet', 'mobile-h', 'mobile-v'] %} {% else %} {% set devices = ['desktop'] %} {% endif %} {% for part in devices %} {% if properties[part] %} {% if part != 'desktop' %} @media (max-width: @const_media_{{ part }}_max_width) { {% endif %} {% for modificator in ['base', 'hover', 'active'] %} {% if properties[part][modificator] %} {% set _modificator = '' %} {% if modificator != 'base' %} {% set _modificator = ':' ~ modificator %} {% endif %} {{ StyleHelper.generateLessFromArray(properties[part][modificator], css_name ~ _modificator) }} {% endif %} {% endfor %} {% if part != 'desktop' %} } {% endif %} {% endif %} {% if (part == 'desktop' and link and link[part]) %} {% for modificator in ['base', 'hover', 'active'] %} {% if link[part][modificator] %} {% set _modificator = '' %} {% if modificator != 'base' %} {% set _modificator = ':' ~ modificator %} {% endif %} {{ StyleHelper.generateLessFromArray(link[part][modificator], css_name ~ ' a' ~ _modificator) }} {% endif %} {% endfor %} {% endif %} {% endfor %} {% endautoescape %}