Hi, I worked with Support and they found the issue, but I’m not sure who to fix it:
I created a block above my product description for “Scent Descriptions”, so users can open/collapse (actually, the assistant created it). This liquid block is pushing the shopping cart icon (at the top right of the page) out of alignment on the page.
I need this collapsible block. How do I fix the code? I’ll post the actual code below the photo.
Welcome to Shopify Community! Can you share your Store URL so I can have a look on it? Also, if you have password enabled then please share the password as well. Your cooperation would be greatly appreciated.
Hello there, if you want to fix the alignment issue of the account icon on your site, then you need to add the code shared below in the end of styles.css file.
For my understanding, what is this code doing? Is it realigning the icons globally on the site? Since this is the theme code, that’s what I’m surmising.
Will this change anything else? It seems when I change one thing for the better, it messes up others The desktop will display correctly and not shift/scroll, right? That happened previously.
Actually this Question asked from @Moeed but I’m sorry if I am interrupting. I would like to answer the Query.
As the class that written in the css is the unique class. It’s not global class that affect on the other elements. Which means adding this css will not causing any other issues.
In previous times, if you face the issue with applying the css globally, then this might be due to using the global classes.
I know it’s marked as solved, but to give a better explanation – the code which AI suggested uses very generic selectors, like details or summary.
There are other elements on the page which are details and summary and these styles would apply to them too. Your “Account” button is details.
One way to avoid these side-effects can be to move what’s between <style> and </style> in the AI-generated code into Product Info section “Custom CSS” setting.
This will apply the code only inside Product Info section.
The fix that was given above uses more specific element selectors and as such, it has much lower possibility for side-effects.
Also, I’d recommend to rather use Shopify’s own AI to generate your codes – it is trained to avoid side-effects.