Hi there, thank you for taking the time to read this!
I’m currently trying to figure out how to create or add a custom ID for a couple of my pages one of them specifically being the customer account login page. I believe a unique page ID will help me achieve custom header colors for these specified pages. I would then access the theme.css.liquid file and add the customizations.
My goal is to be able to unlock individual page CSS control. I hope this all makes sense and if not, please let me know! I’ll do my best to answer. I haven’t found an accurate article related to this so I figured I’d be among the first. Thank you!
To ensure that I’m understanding this correctly, the snippet I can just insert into my Templates > customers/login.liquid?
visual: https://snipboard.io/qnibPg.jpg
Something else that I find myself questioning is that the file is written in Liquid, so if I directly insert HTML, Liquid plays nice with direct HTML inserted into that file?
No, you don’t need to add anything to customers/login.liquid, the code is already there.
Go to your fronted store https:// yourstore.com/account/ and you can check the class associated to the by using Chrome Inspector Tool.
You just need to add the customization you want to the theme.css file.
About file with .liquid extension, they play nice with HTML. In fact they are HTML files and the liquid extension only tells to the Shopify rendering engine to replace the Liquid tags with the specific code.
You just need to add the code at body: template-{{ request.page_type | handle }}
It will create a separate class for all templates. Ex: customer account login page => template-customers-login
Hope it helps!
Hey there, thank you for getting back to me! I find that it gives me a very generic tag which is not ideal since I only want the custom CSS to be applied to this specific page. Shown below. Example of what I see using the inspector tool on this page URL.
I originally thought this and tried this before creating this post with no luck. Came to find out that it applied the changes to all of the pages with the associated header.
I’m possibly misinterpreting what you’re stating so sorry for that in advance if so.
Thanks again for taking the time!
@LitExtension
I’m sorry but I’m a noob. When you say add the code at the body with the generic looking code (guessing I don’t change any of the code?), I’m not sure exactly where I should add that code? To the customer-login file or? Thank you for the response! I’m doing my best to research and learn!
Step 3: You just need to turn on Inspect of the browser to check, at each page it will display a different class for the body.
Ex: https://i.imgur.com/KwA3IPg.png for login page.
Hope it clear to you.