{%- if settings != blank -%}
    {%- if settings.overwrite_theme_background_color != blank -%}
        {%- assign background_color = settings.overwrite_theme_background_color -%}
    {%- endif -%}
    {%- if settings.overwrite_theme_border_color != blank -%}
        {%- assign border_color = settings.overwrite_theme_border_color -%}
    {%- endif -%}
    {%- if settings.overwrite_theme_text_color != blank -%}
        {%- assign text_color = settings.overwrite_theme_text_color -%}
    {%- endif -%}
    {%- if settings.overwrite_theme_font_size != blank -%}
        {%- assign font_size = settings.overwrite_theme_font_size -%}
    {%- endif -%}
    {%- if settings.overwrite_theme_margin_top != blank -%}
        {%- assign margin_top = settings.overwrite_theme_margin_top -%}
    {%- endif -%}
    {%- if settings.overwrite_theme_margin_bottom != blank -%}
        {%- assign margin_bottom = settings.overwrite_theme_margin_bottom -%}
    {%- endif -%}
    {%- if settings.overwrite_theme_padding_top != blank -%}
        {%- assign padding_top = settings.overwrite_theme_padding_top -%}
    {%- endif -%}
    {%- if settings.overwrite_theme_padding_bottom != blank -%}
        {%- assign padding_bottom = settings.overwrite_theme_padding_bottom -%}
    {%- endif -%}
    {%- if settings.overwrite_theme_vertical_padding != blank -%}
        {%- assign padding_top = settings.overwrite_theme_vertical_padding -%}
        {%- assign padding_bottom = settings.overwrite_theme_vertical_padding -%}
    {%- endif -%}
    {%- if settings.overwrite_theme_line_height != blank -%}
        {%- assign line_height = settings.overwrite_theme_line_height -%}
    {%- endif -%}
    {%- if settings.overwrite_theme_font_weight != blank -%}
        {%- assign font_weight = settings.overwrite_theme_font_weight -%}
    {%- endif -%}
    {%- if settings.overwrite_theme_container_horizontal_margin != blank -%}
        {%- assign container_horizontal_margin = settings.overwrite_theme_container_horizontal_margin -%}
    {%- endif -%}
    {%- if settings.text_align != blank -%}
        {%- assign text_align = settings.text_align -%}
    {%- endif -%}
{%- endif -%}

{%- if desktop_settings != blank -%}
    {%- if desktop_settings.desktop_margin_top != blank -%}
        {%- assign margin_top = desktop_settings.desktop_margin_top -%}
    {%- endif -%}
    {%- if desktop_settings.desktop_margin_bottom != blank -%}
        {%- assign margin_bottom = desktop_settings.desktop_margin_bottom -%}
    {%- endif -%}
{%- endif -%}

{%- capture style -%}
    {%- if background_color != blank -%}
        {%- assign alpha = background_color | color_extract: 'alpha' -%}

        {%- if alpha == 1 -%}
            background-color: {{ background_color | color_to_hex }}; 
        {%- endif -%}
    {%- endif -%}


    {%- if border_color != blank -%}
        {%- assign alpha = border_color | color_extract: 'alpha' -%}

        {%- if alpha == 1 -%}
            border-color: {{ border_color | color_to_hex }}; 
        {%- endif -%}
    {%- endif -%}


    {%- if text_color != blank -%}
        {%- assign textAlpha = text_color | color_extract: 'alpha' -%}

        {%- if textAlpha == 1 -%}
            color: {{ text_color | color_to_hex }};
        {%- endif -%}
    {%- endif -%}


    {%- if font_size != blank and font_size > 0 -%}
        font-size: {{ font_size }}px;
    {%- endif -%}


    {%- if margin_top != blank and margin_top != 0 -%}
        margin-top: {{ margin_top }}px;
    {%- endif -%}


    {%- if margin_bottom != blank and margin_bottom != 0 -%}
        margin-bottom: {{ margin_bottom }}px;
    {%- endif -%}


    {%- if padding_top != blank and padding_top != 0 -%}
        padding-top: {{ padding_top }}px;
    {%- endif -%}


    {%- if padding_bottom != blank and padding_bottom != 0 -%}
        padding-bottom: {{ padding_bottom }}px;
    {%- endif -%}


    {%- if text_align != blank -%}
        text-align: {{ text_align }};
    {%- endif -%}


    {%- if line_height != blank and line_height > 0 -%}
        line-height: {{ line_height }}px;
    {%- endif -%}


    {%- if font_weight != blank and font_weight != "0" -%}
        font-weight: {{ font_weight }};
    {%- endif -%}


    {%- if container_horizontal_margin != blank and container_horizontal_margin > 0 -%}
        --mobile-horizontal-margin: {{ container_horizontal_margin }}px;
    {%- endif -%}

    {%- if overwrite_drawer_mobile_width != blank -%}
        --overwrite_drawer_mobile_width: {{ overwrite_drawer_mobile_width }}%;
    {%- endif -%}

    {%- if append_style != blank -%}
        {{ append_style }}
    {%- endif -%}
{%- endcapture -%}

{%- if style != blank -%}
    style="{{ style | strip_newlines | strip }}"
{%- endif -%}