I’ve added the Login with Shop button to my homepage header, however the button is getting cutoff. How can I fix this? I’m using the Refresh theme with no custom code.
Topic summary
A user encountered a visual issue where the “Login with Shop” button in their header was being cut off. They were using the Refresh theme without custom code and also noted the button disappeared entirely after login, with no visible logout option.
Initial Solution Attempt:
- A CSS fix was suggested targeting
.header__icons .shopify-app-blockwithmax-widthandmax-heightset tofit-content - This code included an
htmlselector and@mediaquery
Problem with Initial Code:
- Shopify’s theme customizer rejected the code with an error:
"html" does not appear to be used in this section - The customizer restricts CSS to section-specific selectors, blocking global selectors like
html,body, or@mediaqueries
Working Solution:
The user rewrote the CSS without global context:
- Targeted
.header__icons .shopify-app-blockand its iframe directly - Added
!importantflags andoverflow: visible - Set explicit dimensions for the iframe (180px width)
Status: Resolved. The button now displays correctly without being cut off. The logout visibility issue remains unaddressed.
Please share the link to your store so we can check
https://nailmeharderstore.myshopify.com/ . Another thing is once someone Logs in via SHOP, the button disappears completely. Are there options for them to log out?
Please add this code to Custom CSS of Header in Online Store > Themes > Customize > Header.
@media (min-width: 750px) {
html .header__icons .shopify-app-block {
max-width: fit-content;
max-height: fit-content;
}
}
Thank you - unfortunately it didn’t change the outcome. Also, I can’t see the button once I log-in, not sure how to fix this. I have to use incognito to see the button, but it shows cut-off still
Figured it out - after trying the code provided, i received this error: <“html” does not appear to be used in this section. Try a different selector.> It seems that
-
You can’t use global selectors like html, body, or even @media queries directly unless the section supports them
-
Shopify restricts this input to CSS tied to that section’s DOM tree
To re-write the code without html or Global Context, I used this code:
.header__icons .shopify-app-block {
max-width: fit-content !important;
max-height: fit-content !important;
overflow: visible !important;
}
.header__icons .shopify-app-block iframe {
width: 180px !important;
height: auto !important;
display: block !important;
}
It seems to work now.
Thanks for updating!

