{% set selected = selected|trim %} {% set selected_parts = selected|split(' ') %} {% set direction = direction|default(selected_parts[0])|default('gradient-to-r') %} {% set direction = (directions[direction] is not iterable) ? 'gradient-to-r' : direction %} {% set from_color = from_color|default(selected_parts[1]) %} {% set from_color = from_color|replace({'from-': ''}) %} {% set via_color = via_color|default(selected_parts[2])|replace({'via-': ''}) %} {% set to_color = to_color|default(selected_parts[3])|replace({'to-': ''}) %}
{{ labels.from }}
{{ component('tailwind~color',{ color_only: true, id: component_id ~ '_from_color', selected: from_color }) }}
{{ labels.via }}
{{ component('tailwind~color',{ color_only: true, id: component_id ~ '_via_color', selected: via_color }) }}
{{ labels.to }}
{{ component('tailwind~color',{ color_only: true, id: component_id ~ '_to_color', selected: to_color }) }}
{% if hide_sample != true %}   {% endif %}
{{ labels.direction }}
{{ component('tailwind~dropdown',{ items: directions, selected: direction, id: component_id ~ '_directions' }) }}