简体   繁体   中英

Set Google Plus sign in button type

I have a Google+ sign in button on my site and I can't figure out how to set its style to one of the predefined styles on the Google+ branding guide page. https://developers.google.com/+/branding-guidelines

On the guideline page, the buttons are listed in a table featuring a column 'style' which has differing string values for respective buttons, ie 'Long', 'Short', etc

The button on my page is rendered in a span defined as

  <span
    class="g-signin"
    data-callback="onSignInCallback"
    data-clientid="MY_APP_ID@developer.gserviceaccount.com"
    data-approvalprompt="force"
    data-cookiepolicy="http://mysite.com"
    data-requestvisibleactions="http://schemas.google.com/AddActivity"
    data-scope="https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email">
  </span>

I don't wish to make a purely custom button. Any idea where can I assign the pre-defined style?

You can set the standard style with a combination of the following attributes:

data-height="standard"  (one of short, standard or tall)
data-width="standard"   (one of iconOnly, standard or wide)
data-theme="dark"       (one of light or dark)

These attributes are documented here:

https://developers.google.com/+/web/signin/reference

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM