Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I used smartbanner:disable-positioning but margin-top is still applied to <html> #279

Open
gkatsanos opened this issue Mar 26, 2021 · 4 comments
Milestone

Comments

@gkatsanos
Copy link

gkatsanos commented Mar 26, 2021

Hello! I thought using <meta name="smartbanner:disable-positioning" content="true"> is going to stop the inline margin-top being applied to the html element.
Our issue is that we use a JS framework (Vue/Nuxt) that doesnt really give you programmatic access to the html element. (we need to add the margin manually depending on the value of another variable)
I saw #68 didn't advance, was wondering if there's something else?

Many thanks!

@ain
Copy link
Owner

ain commented Apr 20, 2021

Thanks for the feedback @gkatsanos!

Yes, the solution here will introduce the breaking change and result in v2. The work you referred to was not finalised, diverged and was closed.

@ain ain added this to the 2.0.0 milestone Apr 20, 2021
@warlock1996
Copy link

warlock1996 commented Aug 9, 2021

forsomeone who lands here maybe this could save some time

image

in nuxt/vue u have this hook which runs on client side , lets u remove the html and css for smarbanner !

@sunstarjeff
Copy link

I landed here because the Android version of the banner was showing underneath the website's fixed positioned header/nav. It was adding the 84px margin to the HTML, but the website didn't react to that directive due to the fixed positioning. (It worked fine on iOS though.)

My solution was to supersede the library's styles by adding this CSS to the page:

<style> html {margin-top:0 !important;} .smartbanner.smartbanner--android.js_smartbanner {position:fixed; top:auto; bottom:0; z-index:1000;} </style>

The result is the banner is shown fixed at the bottom of the page.

If you have the means, you could also get rid of the CSS override on HTML element and instead use server-side browser detection to add this meta tag only for non-iOS browsers.

<meta name="smartbanner:disable-positioning" content="true">

@ain
Copy link
Owner

ain commented May 23, 2023

Cool tip @sunstarjeff, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants