Currently when I use the new API for the personalised sign in with google button, when the button is centered vertically in a flex container, when it is loading it flickers up and down.
Example code is shown below, just in html and css for simplicity, however building this in react - same thing happens.
HTML:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="test.css" type="text/css"
></link>
</head>
<body>
<script src="https://accounts.google.com/gsi/client" async defer></script>
<script src="./script.js"></script>
<div
id="g_id_onload"
data-client_id="920029725372-e913v434vc2hfbb6cfkrs7qhiuvuita6.apps.googleusercontent.com"
data-callback="handleCredentialResponse"
></div>
<div class="button-wrapper">
<div class="g_id_signin" data-type="standard"></div>
</div>
</body>
</html>
CSS:
body {
width: 100vw;
height: 100vh;
margin: 0;
}
@font-face {
font-family: "Google Sans";
src: url("https://fonts.gstatic.com/s/googlesans/v14/4UabrENHsxJlGDuGo1OIlLU94YtzCwM.ttf")
format("truetype");
}
.button-wrapper {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
Any help would be greatly appreciated! Sorta wish google would allow for custom buttons or at least an API so that issues like this could be avoided instead of forcing devs to use an <iframe/>, also the new API isn't awesomely documented (I'm assuming because of how new it is but hopefully this will get better with time.