Use object-fit: contain for oauth2 custom icons (#26493) (#26498)

Backport #26493 by @wxiaoguang

It works for various sizes.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 24d6aacc7ee4745799bd2f778c0e2e882099cfa3)
This commit is contained in:
Giteabot 2023-08-15 00:56:15 +08:00 committed by Earl Warren
parent 601df4d472
commit 2f34f1ec21
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -56,7 +56,7 @@ func (p *AuthSourceProvider) DisplayName() string {
func (p *AuthSourceProvider) IconHTML() template.HTML { func (p *AuthSourceProvider) IconHTML() template.HTML {
if p.iconURL != "" { if p.iconURL != "" {
img := fmt.Sprintf(`<img class="gt-mr-3" width="20" height="20" src="%s" alt="%s">`, img := fmt.Sprintf(`<img class="gt-object-contain gt-mr-3" width="20" height="20" src="%s" alt="%s">`,
html.EscapeString(p.iconURL), html.EscapeString(p.DisplayName()), html.EscapeString(p.iconURL), html.EscapeString(p.DisplayName()),
) )
return template.HTML(img) return template.HTML(img)