Customer in css liquid

husain
New Member
3 0 0

Hi 

I am trying to do this in my style.css.liquid but its not working.

 

{%- if customer -%}


{%- assign col_nav_bar_bg = settings.col_head_nav_bg_login -%}
{%- else -%}

{%- assign col_nav_bar_bg = settings.col_head_nav_bg -%}
{%- endif -%}

How can I get this to work? It seems like it does not recognise the object customer 

0 Likes
Propero
Shopify Partner
801 92 136

@husain Customer object is only available once the store is stored is rendered and CSS is already rendered without customer object so you cant make it work this way.

If you need to change the style on front end based on customer object, you need to use javascript

- Was my reply helpful? Click Like or Click Accept as Solution
To hire: email us at shopify@propero.in
checkout our app https://apps.shopify.com/picamaze
husain
New Member
3 0 0

Could you help me as to where and how I can do this?

0 Likes