{% liquid assign order = 'logo,menu,localization,search,drawer_search,actions' if shop.customer_accounts_enabled assign order = 'drawer_search,logo,menu,localization,search,actions' endif assign rows = 'top,bottom' | split: ',' assign search_style = 'none' if section.settings.show_search assign search_style = 'modal' endif if section.settings.show_search render 'slideshow-styles' endif if section.settings.enable_transparent_header_home and template.name == 'index' assign transparent = 'always' assign transparent_text_color_setting = section.settings.text_color_transparent_home elsif section.settings.enable_transparent_header_product and template.name == 'product' assign transparent = 'always' assign transparent_text_color_setting = section.settings.text_color_transparent_product elsif section.settings.enable_transparent_header_collection and template.name == 'collection' assign transparent = 'always' assign transparent_text_color_setting = section.settings.text_color_transparent_collection endif if section.settings.enable_sticky_header == 'always' assign sticky = 'always' elsif section.settings.enable_sticky_header == 'scroll-up' assign sticky = 'scroll-up' endif if transparent and sticky assign transparent = 'not-sticky' endif assign text_color_transparent = transparent_text_color_setting | default: settings.page_text_color assign transparent_text_brightness = text_color_transparent | color_brightness if transparent_text_brightness > 128 assign transparent_text_contrast = 'var(--palette-darkest)' else assign transparent_text_contrast = 'var(--palette-lightest)' endif # Cart bubble colors: custom styles apply in every header state; default # mirrors the top row's effective text color, with a contrasting text color. if section.settings.bubble_style == 'custom' or section.settings.text_color_top != blank or section.settings.background_color_top != blank assign cart_bubble_color_override = true endif if cart_bubble_color_override if section.settings.bubble_style == 'custom' assign cart_bubble_background = section.settings.bubble_background_color | default: section.settings.text_color_top | default: settings.page_text_color assign cart_bubble_text = section.settings.bubble_text_color | default: section.settings.background_color_top | default: settings.page_background_color elsif section.settings.text_color_top != blank assign cart_bubble_background = section.settings.text_color_top if section.settings.background_color_top != blank assign cart_bubble_text = section.settings.background_color_top else assign cart_bubble_bg_brightness = cart_bubble_background | color_brightness if cart_bubble_bg_brightness > 128 assign cart_bubble_text = 'var(--palette-darkest)' else assign cart_bubble_text = 'var(--palette-lightest)' endif endif elsif section.settings.background_color_top != blank assign bg_top = section.settings.background_color_top assign bg_top_brightness = bg_top | color_brightness assign cart_bubble_text = bg_top if bg_top_brightness > 128 assign cart_bubble_background = 'var(--palette-darkest)' else assign cart_bubble_background = 'var(--palette-lightest)' endif endif endif capture logo content_for 'block', type: '_header-logo', id: 'header-logo' endcapture capture menu content_for 'block', type: '_header-menu', id: 'header-menu' endcapture capture drawer_menu content_for 'block', type: '_header-menu', id: 'header-menu', variant: 'mobile' endcapture capture navigation_bar content_for 'block', type: '_header-menu', id: 'header-menu', variant: 'navigation_bar', transparent: transparent endcapture assign has_navigation_bar = false if navigation_bar contains 'data-navigation-bar-enabled' assign has_navigation_bar = true endif capture actions render 'header-actions', customer_account_menu: section.settings.customer_account_menu, display_style: section.settings.actions_display_style, section: section endcapture if shop.customer_accounts_enabled assign search_class = 'search-action--hidden-on-drawer' endif # Handle localization positioning if section.settings.localization_position == 'left' if section.settings.search_position == 'left' if shop.customer_accounts_enabled assign order = 'drawer_search,logo,search,localization,menu,actions' else assign order = 'logo,search,localization,menu,drawer_search,actions' endif else if shop.customer_accounts_enabled assign order = 'drawer_search,logo,localization,menu,search,actions' else assign order = 'logo,localization,menu,search,drawer_search,actions' endif endif else if section.settings.search_position == 'left' if shop.customer_accounts_enabled assign order = 'drawer_search,logo,search,menu,localization,actions' else assign order = 'logo,search,menu,localization,drawer_search,actions' endif endif endif capture search render 'search', style: search_style, class: search_class, display_style: section.settings.actions_display_style endcapture # Skip drawer search under specific conditions: # Always render if search_row is bottom # Don't render when shop.customer_accounts_enabled is false and search_position is left and search_style is not none assign skip_drawer_search = false if shop.customer_accounts_enabled == false and section.settings.search_position == 'left' and search_style != 'none' assign skip_drawer_search = true endif if section.settings.search_row == 'bottom' or search_style != 'none' and skip_drawer_search == false # Mobile search duplicate for when search is not in the right order for mobile layout capture drawer_search render 'search', class: 'search-action--hidden-on-menu', style: search_style, display_style: section.settings.actions_display_style endcapture endif assign show_language = section.settings.show_language if localization.available_languages.size <= 1 assign show_language = false endif assign show_country = section.settings.show_country if localization.available_countries.size <= 1 assign show_country = false endif assign bottom_row_blocks = '' if section.settings.menu_row == 'bottom' assign bottom_row_blocks = bottom_row_blocks | append: 'menu,' endif if section.settings.show_search if section.settings.search_row == 'bottom' assign bottom_row_blocks = bottom_row_blocks | append: 'search,' endif endif if section.settings.show_country or section.settings.show_language if section.settings.localization_row == 'bottom' assign bottom_row_blocks = bottom_row_blocks | append: 'localization,' endif endif assign bottom_row_blocks = bottom_row_blocks | split: ',' | compact assign has_second_row = false if bottom_row_blocks.size > 0 assign has_second_row = true endif if section.settings.section_height == 'compact' assign header_height_class = ' header--compact' endif if bottom_row_blocks.size > 0 and section.settings.background_color_top == section.settings.background_color_bottom and section.settings.divider_width == 0 assign collapse_header_paddings_class = 'header--collapse-row-paddings' endif assign class = 'header' if header_height_class assign class = class | append: ' ' | append: header_height_class endif if collapse_header_paddings_class assign class = class | append: ' ' | append: collapse_header_paddings_class endif # Determine transparent background value assign top_transparent = false assign bottom_transparent = false # Only explicit colors make a row transparent assign top_row_color = section.settings.background_color_top assign bottom_row_color = section.settings.background_color_bottom if top_row_color != blank and top_row_color.alpha != 1 assign top_transparent = true endif if bottom_row_color != blank and bottom_row_color.alpha != 1 and has_second_row assign bottom_transparent = true endif if top_transparent and bottom_transparent assign background_transparent_color_value = 'both' elsif top_transparent assign background_transparent_color_value = 'top' elsif bottom_transparent assign background_transparent_color_value = 'bottom' endif %} {% capture localization_markup %} {% liquid assign localization_font = '--menu-localization-font: var(--font-[localization_font]--family); ' | replace: '[localization_font]', section.settings.localization_font assign localization_font_size = '--menu-localization-font-size: [localization_font_size]; ' | replace: '[localization_font_size]', section.settings.localization_font_size assign color_shadow = '--color-shadow: rgb(var(--color-foreground-rgb) / var(--opacity-10-25));' assign form_style = localization_font | append: localization_font_size | append: color_shadow %} {% if show_language and show_country == false %}