]> source.dussan.org Git - gitea.git/commitdiff
Use `object-fit: contain` for oauth2 custom icons (#26493) (#26498)
authorGiteabot <teabot@gitea.io>
Mon, 14 Aug 2023 16:56:15 +0000 (00:56 +0800)
committerGitHub <noreply@github.com>
Mon, 14 Aug 2023 16:56:15 +0000 (16:56 +0000)
Backport #26493 by @wxiaoguang

It works for various sizes.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
services/auth/source/oauth2/providers.go

index 16620fad6dc3440e918701583749d39f556e005b..7572aa20c0a13de9b64fb949b4fae15f5a7a069f 100644 (file)
@@ -56,7 +56,7 @@ func (p *AuthSourceProvider) DisplayName() string {
 
 func (p *AuthSourceProvider) IconHTML() template.HTML {
        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()),
                )
                return template.HTML(img)