Skip to content

Commit

Permalink
Use object-fit: contain for oauth2 custom icons (#26493) (#26498)
Browse files Browse the repository at this point in the history
Backport #26493 by @wxiaoguang

It works for various sizes.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
  • Loading branch information
GiteaBot and wxiaoguang authored Aug 14, 2023
1 parent d1a55aa commit 24d6aac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion services/auth/source/oauth2/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 24d6aac

Please sign in to comment.