{# Ultra-Optimized Button Module - Mobile-first with desktop enhancements #} {# Mobile: Ultra-minimal critical inline CSS (only alignment) #} {% if module.styles.alignment.alignment.horizontal_align %} {% endif %} {# Link preparation #} {% set href = module.link.url.href %} {% if module.link.url.type == "EMAIL_ADDRESS" %} {% set href = "mailto:" ~ href %} {% endif %} {% set rel = [] %} {% if module.link.no_follow %} {% do rel.append("nofollow") %} {% endif %} {% if module.link.open_in_new_tab %} {% do rel.append("noopener") %} {% endif %} {# Determine if custom styles are needed #} {% set has_custom_bg = module.styles.background.color.color %} {% set has_custom_border = module.styles.border.border.css %} {% set has_custom_radius = module.styles.corner.radius is not none %} {% set has_custom_font = module.styles.text.font.css %} {% set has_custom_spacing = module.styles.spacing.spacing.css %} {% set needs_custom = has_custom_bg or has_custom_border or has_custom_radius or has_custom_font or has_custom_spacing %} {# Button HTML - uses theme .btn class by default #}
{# Desktop: Enhanced styles loaded asynchronously (non-blocking) #} {% if needs_custom %} {% require_css %} {% end_require_css %} {% endif %}